diff --git a/services/iaasalpha/api_default.go b/services/iaasalpha/api_default.go index 148e51e54..d8a00fa5b 100644 --- a/services/iaasalpha/api_default.go +++ b/services/iaasalpha/api_default.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -25,25144 +25,472 @@ import ( type DefaultApi interface { /* - AddMemberToVirtualIP Add a member to the virtual IP. - Atomically add a member to the virtual IP. + 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 projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiAddMemberToVirtualIPRequest + @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 */ - AddMemberToVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiAddMemberToVirtualIPRequest + AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest /* - AddMemberToVirtualIPExecute executes the request + AddRoutesToRoutingTableExecute 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return VirtualIp + @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 */ - AddMemberToVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) + AddRoutesToRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) /* - AddNetworkToServer Create and attach a network interface from the specified network. - Create and attach a network interface from the specified network to the server. + 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 projectId The identifier (ID) of a STACKIT Project. - @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 - /* - AddNetworkToServerExecute executes the request - + @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 */ - AddNetworkToServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error + AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest /* - AddNicToServer Attach an existing network interface. - Attach an existing network interface to a server. + AddRoutingTableToAreaExecute 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 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 - /* - AddNicToServerExecute executes the request + @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 */ - AddNicToServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error + AddRoutingTableToAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTable, error) /* - AddPublicIpToServer Associate a public IP to the server. - Associate a public IP to a server. + CreateNetwork Create new network. + 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 projectId The identifier (ID) of a STACKIT Project. - @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 - /* - AddPublicIpToServerExecute executes the request - + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest */ - AddPublicIpToServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error + CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest /* - AddSecurityGroupToServer Add a server to a security group. - Add an existing server to an existing security group. + 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 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 - /* - AddSecurityGroupToServerExecute executes the request + @param region The STACKIT Region of the resources. + @return Network */ - AddSecurityGroupToServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error + CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) /* - AddServiceAccountToServer Attach service account to a server. - Attach an additional service account to the server. + DeleteNetwork Delete network. + 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 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 region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest */ - AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest + DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest /* - 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 serverId The identifier (ID) of a STACKIT Server. - @param serviceAccountMail The e-mail address of a service account. - @return ServiceAccountMailListResponse + DeleteNetworkExecute executes the request */ - AddServiceAccountToServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) + DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* - AddVolumeToServer Attach a volume to a server. - Attach an existing volume to an existing server. + 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 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 ApiAddVolumeToServerRequest + @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 */ - AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest + DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest /* - 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 serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return VolumeAttachment + DeleteRouteFromRoutingTableExecute executes the request */ - AddVolumeToServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) + DeleteRouteFromRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) error /* - CreateAffinityGroup Create a new affinity group in a project. - Create a new server affinity group in the given project ID. + 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 projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateAffinityGroupRequest + @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 */ - CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest + DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest /* - 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. - @return AffinityGroup + DeleteRoutingTableFromAreaExecute executes the request */ - CreateAffinityGroupExecute(ctx context.Context, projectId string) (*AffinityGroup, error) + DeleteRoutingTableFromAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) error /* - CreateBackup Create new Backup. - Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + 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. - @return ApiCreateBackupRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest */ - CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest + GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest /* - CreateBackupExecute executes the request + 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. - @return Backup + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return Network */ - CreateBackupExecute(ctx context.Context, projectId string) (*Backup, error) + GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, 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. + 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 projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateImageRequest + @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 */ - CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest + GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest /* - CreateImageExecute executes the request + GetRouteOfRoutingTableExecute 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. - @return ImageCreateResponse + @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 */ - CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) + GetRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, 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. + 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(). - @return ApiCreateKeyPairRequest + @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 */ - CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest + GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest /* - CreateKeyPairExecute executes the request + GetRoutingTableOfAreaExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return Keypair + @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 */ - CreateKeyPairExecute(ctx context.Context) (*Keypair, error) + GetRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) /* - CreateNetwork Create new network. - 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. + ListNetworks List all networks inside a project. + 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 projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateNetworkRequest + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest */ - CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest + ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest /* - CreateNetworkExecute executes the request + 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. - @return Network - - */ - CreateNetworkExecute(ctx context.Context, projectId string) (*Network, error) - /* - CreateNetworkArea Create new network area in an organization. - 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. - @return ApiCreateNetworkAreaRequest - */ - CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest - /* - CreateNetworkAreaExecute 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. - @return NetworkArea + @param region The STACKIT Region of the resources. + @return NetworkListResponse */ - CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) + ListNetworksExecute(ctx context.Context, projectId string, region string) (*NetworkListResponse, error) /* - CreateNetworkAreaRange Create new network range in a network area. - Create a new network range in an existing network area. + 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. - @return ApiCreateNetworkAreaRangeRequest + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest */ - CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest + ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest /* - CreateNetworkAreaRangeExecute executes the request + 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. - @return NetworkRangeListResponse + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return RouteListResponse */ - CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) + ListRoutesOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) /* - CreateNetworkAreaRoute Create new network routes. - Create one or several new network routes in a network area. + 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. - @return ApiCreateNetworkAreaRouteRequest + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest */ - CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest + ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest /* - CreateNetworkAreaRouteExecute executes the request + 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. - @return RouteListResponse - - */ - CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) - /* - CreateNic Create new network interface. - Create a new network interface in a project. + @param region The STACKIT Region of the resources. + @return RoutingTableListResponse - @param ctx context.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 */ - CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest + ListRoutingTablesOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTableListResponse, error) /* - CreateNicExecute executes the request + 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 NIC - - */ - CreateNicExecute(ctx context.Context, projectId 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. - @return ApiCreatePublicIPRequest + @return ApiPartialUpdateNetworkRequest */ - CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest + PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest /* - 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. - @return PublicIp + PartialUpdateNetworkExecute executes the request */ - CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) + PartialUpdateNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* - CreateSecurityGroup Create new security group. - Create a new security group in a project. + 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 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. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest */ - CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest + UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest /* - CreateSecurityGroupExecute executes the request + UpdateRouteOfRoutingTableExecute 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. - @return SecurityGroup + @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 */ - CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) + UpdateRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) /* - CreateSecurityGroupRule Create new security group rule. - Create a new security group rule in a project. + 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 projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiCreateSecurityGroupRuleRequest + @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 */ - CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest + UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest /* - CreateSecurityGroupRuleExecute executes the request + UpdateRoutingTableOfAreaExecute 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return SecurityGroupRule + @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 */ - CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) - /* - CreateServer Create new server. - Create a new server in a project. + UpdateRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) +} - @param ctx context.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 - */ - CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest - /* - CreateServerExecute executes the request +type ApiAddRoutesToRoutingTableRequest interface { + // Request an addition of routes to a routing table. + AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest + Execute() (*RouteListResponse, error) +} - @param ctx context.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 Server +type ApiAddRoutingTableToAreaRequest interface { + // Request an addition of a routing table to an area. + AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest + Execute() (*RoutingTable, error) +} - */ - CreateServerExecute(ctx context.Context, projectId string) (*Server, error) - /* - CreateSnapshot Create new Snapshot. - Create a new Snapshot from a Volume in a project. +type ApiCreateNetworkRequest interface { + // Request a network creation. + CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest + Execute() (*Network, error) +} - @param ctx context.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 - */ - CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest - /* - CreateSnapshotExecute executes the request +type ApiDeleteNetworkRequest interface { + Execute() error +} - @param ctx context.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 Snapshot +type ApiDeleteRouteFromRoutingTableRequest interface { + Execute() error +} - */ - CreateSnapshotExecute(ctx context.Context, projectId string) (*Snapshot, error) - /* - CreateVirtualIP Create new virtual IP. - Create a new virtual IP in a project. +type ApiDeleteRoutingTableFromAreaRequest interface { + Execute() error +} - @param ctx context.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 ApiCreateVirtualIPRequest - */ - CreateVirtualIP(ctx context.Context, projectId string, networkId string) ApiCreateVirtualIPRequest - /* - CreateVirtualIPExecute executes the request +type ApiGetNetworkRequest interface { + Execute() (*Network, error) +} - @param ctx context.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 VirtualIp +type ApiGetRouteOfRoutingTableRequest interface { + Execute() (*Route, error) +} - */ - CreateVirtualIPExecute(ctx context.Context, projectId string, networkId string) (*VirtualIp, 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. +type ApiGetRoutingTableOfAreaRequest interface { + Execute() (*RoutingTable, error) +} - @param ctx context.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 - */ - CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest - /* - CreateVolumeExecute executes the request +type ApiListNetworksRequest interface { + // Filter resources by labels. + LabelSelector(labelSelector string) ApiListNetworksRequest + Execute() (*NetworkListResponse, error) +} - @param ctx context.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 Volume +type ApiListRoutesOfRoutingTableRequest interface { + // Filter resources by labels. + LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest + Execute() (*RouteListResponse, error) +} - */ - CreateVolumeExecute(ctx context.Context, projectId 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. +type ApiListRoutingTablesOfAreaRequest interface { + // Filter resources by labels. + LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest + Execute() (*RoutingTableListResponse, error) +} - @param ctx context.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 - */ - DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest - /* - DeallocateServerExecute executes the request +type ApiPartialUpdateNetworkRequest interface { + // Request an update of a network. + PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest + Execute() error +} - */ - DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error - /* - DeleteAffinityGroup Delete a affinity group in a project. - Delete a affinity group in the given project. +type ApiUpdateRouteOfRoutingTableRequest interface { + // Request an update of a route in a routing table. + UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest + Execute() (*Route, error) +} - @param ctx context.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 - */ - DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest - /* - DeleteAffinityGroupExecute executes the request +type ApiUpdateRoutingTableOfAreaRequest interface { + // Request an update of a routing table. + UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest + Execute() (*RoutingTable, error) +} - */ - DeleteAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) error - /* - DeleteBackup Delete a backup. - Delete a backup that is part of the project. +// DefaultApiService DefaultApi service +type DefaultApiService service - @param ctx context.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 - */ - DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest - /* - DeleteBackupExecute executes the request +type AddRoutesToRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload +} - */ - DeleteBackupExecute(ctx context.Context, projectId string, backupId string) error - /* - DeleteImage Delete an Image. - Delete an image that is part of the project. +// Request an addition of routes to 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageRequest - */ - DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest - /* - DeleteImageExecute executes the request +func (r AddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { + r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload + return r +} - */ - DeleteImageExecute(ctx context.Context, projectId string, imageId string) error - /* - DeleteImageShare Remove image share. - Remove the image share. New scope will be local. +func (r AddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + 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.AddRoutesToRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } - @param ctx context.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 - */ - DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest - /* - DeleteImageShareExecute executes the request - - */ - DeleteImageShareExecute(ctx context.Context, projectId 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 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 - /* - DeleteImageShareConsumerExecute executes the request - - */ - DeleteImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) error - /* - DeleteKeyPair Delete an SSH keypair. - 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 keypairName The name of an SSH keypair. - @return ApiDeleteKeyPairRequest - */ - DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest - /* - DeleteKeyPairExecute executes the request - - */ - DeleteKeyPairExecute(ctx context.Context, keypairName string) error - /* - DeleteNetwork Delete network. - 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 projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiDeleteNetworkRequest - */ - DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest - /* - DeleteNetworkExecute executes the request - - */ - DeleteNetworkExecute(ctx context.Context, projectId 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. - - @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 - */ - DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest - /* - DeleteNetworkAreaExecute executes the request - - */ - DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error - /* - DeleteNetworkAreaRange Delete a network range. - 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 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 - */ - DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest - /* - DeleteNetworkAreaRangeExecute executes the request - - */ - DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) error - /* - DeleteNetworkAreaRoute Delete a network route. - 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 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 - */ - DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest - /* - DeleteNetworkAreaRouteExecute executes the request - - */ - DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId 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 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 - /* - DeleteNicExecute executes the request - - */ - DeleteNicExecute(ctx context.Context, projectId 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 publicIpId The identifier (ID) of a Public IP. - @return ApiDeletePublicIPRequest - */ - DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest - /* - DeletePublicIPExecute executes the request - - */ - DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiDeleteSecurityGroupRequest - */ - DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest - /* - DeleteSecurityGroupExecute executes the request - - */ - DeleteSecurityGroupExecute(ctx context.Context, projectId 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 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 - /* - DeleteSecurityGroupRuleExecute executes the request - - */ - DeleteSecurityGroupRuleExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest - */ - DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest - /* - DeleteServerExecute executes the request - - */ - DeleteServerExecute(ctx context.Context, projectId 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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiDeleteSnapshotRequest - */ - DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest - /* - DeleteSnapshotExecute executes the request - - */ - DeleteSnapshotExecute(ctx context.Context, projectId string, snapshotId string) error - /* - DeleteVirtualIP Delete a virtual IP. - Delete a virtual 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiDeleteVirtualIPRequest - */ - DeleteVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiDeleteVirtualIPRequest - /* - DeleteVirtualIPExecute executes the request - - */ - DeleteVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest - */ - DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest - /* - DeleteVolumeExecute executes the request - - */ - DeleteVolumeExecute(ctx context.Context, projectId 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 affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return ApiGetAffinityGroupRequest - */ - GetAffinityGroup(ctx context.Context, projectId 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 affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return AffinityGroup - - */ - GetAffinityGroupExecute(ctx context.Context, projectId 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 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 - /* - 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 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) - /* - 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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiGetBackupRequest - */ - GetBackup(ctx context.Context, projectId 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 backupId The identifier (ID) of a STACKIT Backup. - @return Backup - - */ - GetBackupExecute(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageRequest - */ - GetImage(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return Image - - */ - GetImageExecute(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageShareRequest - */ - GetImageShare(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ImageShare - - */ - GetImageShareExecute(ctx context.Context, projectId 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 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 - /* - 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 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) - /* - GetKeyPair Get SSH keypair details. - 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 keypairName The name of an SSH keypair. - @return ApiGetKeyPairRequest - */ - GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest - /* - GetKeyPairExecute executes the request - - @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 Keypair - - */ - GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) - /* - GetMachineType Get details about a machine type. - 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 machineType STACKIT machine type Name. - @return ApiGetMachineTypeRequest - */ - GetMachineType(ctx context.Context, projectId 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 machineType STACKIT machine type Name. - @return MachineType - - */ - GetMachineTypeExecute(ctx context.Context, projectId 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 networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest - */ - GetNetwork(ctx context.Context, projectId 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 networkId The identifier (ID) of a STACKIT Network. - @return Network - - */ - GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) - /* - GetNetworkArea Get details about a network area. - 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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiGetNetworkAreaRequest - */ - GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest - /* - GetNetworkAreaExecute 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 NetworkArea - - */ - GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) - /* - GetNetworkAreaRange Get details about a network range. - 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 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 - */ - GetNetworkAreaRange(ctx context.Context, organizationId string, areaId 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 networkRangeId The identifier (ID) of a STACKIT Network Range. - @return NetworkRange - - */ - GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) (*NetworkRange, error) - /* - GetNetworkAreaRoute Get details about a network route. - 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 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 - */ - GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId 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 routeId The identifier (ID) of a STACKIT Route. - @return Route - - */ - GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) - /* - GetNic Get details about a network interface of a network. - 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 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 - /* - 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 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) - /* - 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. - - @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 - */ - GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest - /* - GetOrganizationRequestExecute 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 requestId The identifier (ID) of a STACKIT Request. - @return Request - - */ - GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) - /* - GetProjectDetails Get project details. - 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 projectId The identifier (ID) of a STACKIT Project. - @return ApiGetProjectDetailsRequest - */ - GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest - /* - GetProjectDetailsExecute 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. - @return Project - - */ - GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) - /* - GetProjectNIC Get details about a network interface of a project. - 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 projectId The identifier (ID) of a STACKIT Project. - @param nicId The identifier (ID) of a network interface. - @return ApiGetProjectNICRequest - */ - GetProjectNIC(ctx context.Context, projectId 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 nicId The identifier (ID) of a network interface. - @return NIC - - */ - GetProjectNICExecute(ctx context.Context, projectId 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 requestId The identifier (ID) of a STACKIT Request. - @return ApiGetProjectRequestRequest - */ - GetProjectRequest(ctx context.Context, projectId 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 requestId The identifier (ID) of a STACKIT Request. - @return Request - - */ - GetProjectRequestExecute(ctx context.Context, projectId 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 publicIpId The identifier (ID) of a Public IP. - @return ApiGetPublicIPRequest - */ - GetPublicIP(ctx context.Context, projectId 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 publicIpId The identifier (ID) of a Public IP. - @return PublicIp - - */ - GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiGetSecurityGroupRequest - */ - GetSecurityGroup(ctx context.Context, projectId 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return SecurityGroup - - */ - GetSecurityGroupExecute(ctx context.Context, projectId 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 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 - /* - 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 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) - /* - 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest - */ - GetServer(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return Server - - */ - GetServerExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest - */ - GetServerConsole(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ServerConsoleUrl - - */ - GetServerConsoleExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerLogRequest - */ - GetServerLog(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return GetServerLog200Response - - */ - GetServerLogExecute(ctx context.Context, projectId 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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiGetSnapshotRequest - */ - GetSnapshot(ctx context.Context, projectId 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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return Snapshot - - */ - GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) - /* - GetVirtualIP Get details about a virtual IP. - Get details about a virtual 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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiGetVirtualIPRequest - */ - GetVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiGetVirtualIPRequest - /* - GetVirtualIPExecute 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return VirtualIp - - */ - GetVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetVolumeRequest - */ - GetVolume(ctx context.Context, projectId 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 volumeId The identifier (ID) of a STACKIT Volume. - @return Volume - - */ - GetVolumeExecute(ctx context.Context, projectId 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 volumePerformanceClass The name of a STACKIT Volume performance class. - @return ApiGetVolumePerformanceClassRequest - */ - GetVolumePerformanceClass(ctx context.Context, projectId 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 volumePerformanceClass The name of a STACKIT Volume performance class. - @return VolumePerformanceClass - - */ - GetVolumePerformanceClassExecute(ctx context.Context, projectId 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. - @return ApiListAffinityGroupsRequest - */ - ListAffinityGroups(ctx context.Context, projectId 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. - @return AffinityGroupListResponse - - */ - ListAffinityGroupsExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListAttachedVolumesRequest - */ - ListAttachedVolumes(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return VolumeAttachmentListResponse - - */ - ListAttachedVolumesExecute(ctx context.Context, projectId 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(). - @return ApiListAvailabilityZonesRequest - */ - ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest - /* - ListAvailabilityZonesExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AvailabilityZoneListResponse - - */ - ListAvailabilityZonesExecute(ctx context.Context) (*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. - @return ApiListBackupsRequest - */ - ListBackups(ctx context.Context, projectId 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. - @return BackupListResponse - - */ - ListBackupsExecute(ctx context.Context, projectId 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. - @return ApiListImagesRequest - */ - ListImages(ctx context.Context, projectId 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. - @return ImageListResponse - - */ - ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) - /* - ListKeyPairs List all SSH keypairs for the requesting user. - 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 ApiListKeyPairsRequest - */ - ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest - /* - ListKeyPairsExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return KeyPairListResponse - - */ - ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) - /* - ListMachineTypes List all machine types available for 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 ApiListMachineTypesRequest - */ - ListMachineTypes(ctx context.Context, projectId 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. - @return MachineTypeListResponse - - */ - ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) - /* - ListNetworkAreaProjects List all projects using a network area. - 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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaProjectsRequest - */ - ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest - /* - ListNetworkAreaProjectsExecute 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 ProjectListResponse - - */ - ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) - /* - ListNetworkAreaRanges List all network ranges in a network area. - 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(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaRangesRequest - */ - ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId 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. - @return NetworkRangeListResponse - - */ - ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) - /* - ListNetworkAreaRoutes List all network routes in 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 ApiListNetworkAreaRoutesRequest - */ - ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId 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. - @return RouteListResponse - - */ - ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) - /* - ListNetworkAreas List all network areas in an organization. - 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. - @return ApiListNetworkAreasRequest - */ - ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest - /* - ListNetworkAreasExecute 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. - @return NetworkAreaListResponse - - */ - ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) - /* - ListNetworks List all networks inside a project. - 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 projectId The identifier (ID) of a STACKIT Project. - @return ApiListNetworksRequest - */ - ListNetworks(ctx context.Context, projectId 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. - @return NetworkListResponse - - */ - ListNetworksExecute(ctx context.Context, projectId 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 networkId The identifier (ID) of a STACKIT Network. - @return ApiListNicsRequest - */ - ListNics(ctx context.Context, projectId 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 networkId The identifier (ID) of a STACKIT Network. - @return NICListResponse - - */ - ListNicsExecute(ctx context.Context, projectId 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. - @return ApiListProjectNICsRequest - */ - ListProjectNICs(ctx context.Context, projectId 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. - @return NICListResponse - - */ - ListProjectNICsExecute(ctx context.Context, projectId string) (*NICListResponse, error) - /* - ListPublicIPs List all public IPs 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 ApiListPublicIPsRequest - */ - ListPublicIPs(ctx context.Context, projectId 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. - @return PublicIpListResponse - - */ - ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) - /* - ListPublicIpRanges List all public IP ranges. - 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(). - @return ApiListPublicIpRangesRequest - */ - ListPublicIpRanges(ctx context.Context) ApiListPublicIpRangesRequest - /* - ListPublicIpRangesExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return PublicNetworkListResponse - - */ - ListPublicIpRangesExecute(ctx context.Context) (*PublicNetworkListResponse, 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. - @return ApiListQuotasRequest - */ - ListQuotas(ctx context.Context, projectId 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. - @return QuotaListResponse - - */ - ListQuotasExecute(ctx context.Context, projectId string) (*QuotaListResponse, 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiListSecurityGroupRulesRequest - */ - ListSecurityGroupRules(ctx context.Context, projectId 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return SecurityGroupRuleListResponse - - */ - ListSecurityGroupRulesExecute(ctx context.Context, projectId 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. - @return ApiListSecurityGroupsRequest - */ - ListSecurityGroups(ctx context.Context, projectId 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. - @return SecurityGroupListResponse - - */ - ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) - /* - 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerNicsRequest - */ - ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest - /* - 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 serverId The identifier (ID) of a STACKIT Server. - @return NICListResponse - - */ - ListServerNicsExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerServiceAccountsRequest - */ - ListServerServiceAccounts(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ServiceAccountMailListResponse - - */ - ListServerServiceAccountsExecute(ctx context.Context, projectId 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. - @return ApiListServersRequest - */ - ListServers(ctx context.Context, projectId 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. - @return ServerListResponse - - */ - ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) - /* - ListSnapshots 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 - */ - ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest - /* - ListSnapshotsExecute 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. - @return SnapshotListResponse - - */ - ListSnapshotsExecute(ctx context.Context, projectId string) (*SnapshotListResponse, error) - /* - ListVirtualIPs List all virtual IPs inside a project. - Get a list of all virtual 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. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiListVirtualIPsRequest - */ - ListVirtualIPs(ctx context.Context, projectId string, networkId string) ApiListVirtualIPsRequest - /* - ListVirtualIPsExecute 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 networkId The identifier (ID) of a STACKIT Network. - @return VirtualIpListResponse - - */ - ListVirtualIPsExecute(ctx context.Context, projectId string, networkId string) (*VirtualIpListResponse, 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. - @return ApiListVolumePerformanceClassesRequest - */ - ListVolumePerformanceClasses(ctx context.Context, projectId 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. - @return VolumePerformanceClassListResponse - - */ - ListVolumePerformanceClassesExecute(ctx context.Context, projectId 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. - @return ApiListVolumesRequest - */ - ListVolumes(ctx context.Context, projectId 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. - @return VolumeListResponse - - */ - ListVolumesExecute(ctx context.Context, projectId 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 networkId The identifier (ID) of a STACKIT Network. - @return ApiPartialUpdateNetworkRequest - */ - PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest - /* - PartialUpdateNetworkExecute executes the request - - */ - PartialUpdateNetworkExecute(ctx context.Context, projectId string, networkId string) error - /* - PartialUpdateNetworkArea Update network area settings. - Update the settings of 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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiPartialUpdateNetworkAreaRequest - */ - PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest - /* - PartialUpdateNetworkAreaExecute 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 NetworkArea - - */ - PartialUpdateNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) - /* - RebootServer Reboot the server. - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. - - @param ctx context.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 ApiRebootServerRequest - */ - RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest - /* - RebootServerExecute executes the request - - */ - RebootServerExecute(ctx context.Context, projectId string, serverId string) error - /* - RemoveMemberFromVirtualIP Remove a member from the virtual IP. - Atomically remove a member from the virtual IP. - - @param ctx context.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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiRemoveMemberFromVirtualIPRequest - */ - RemoveMemberFromVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiRemoveMemberFromVirtualIPRequest - /* - RemoveMemberFromVirtualIPExecute 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return VirtualIp - - */ - RemoveMemberFromVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, 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 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 - /* - RemoveNetworkFromServerExecute executes the request - - */ - RemoveNetworkFromServerExecute(ctx context.Context, projectId 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 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 - /* - RemoveNicFromServerExecute executes the request - - */ - RemoveNicFromServerExecute(ctx context.Context, projectId 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 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 - /* - RemovePublicIpFromServerExecute executes the request - - */ - RemovePublicIpFromServerExecute(ctx context.Context, projectId 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 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 - /* - RemoveSecurityGroupFromServerExecute executes the request - - */ - RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId 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 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 - /* - 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 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) - /* - 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 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 - /* - RemoveVolumeFromServerExecute executes the request - - */ - RemoveVolumeFromServerExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiRescueServerRequest - */ - RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest - /* - RescueServerExecute executes the request - - */ - RescueServerExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiResizeServerRequest - */ - ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest - /* - ResizeServerExecute executes the request - - */ - ResizeServerExecute(ctx context.Context, projectId 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiResizeVolumeRequest - */ - ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest - /* - ResizeVolumeExecute executes the request - - */ - ResizeVolumeExecute(ctx context.Context, projectId 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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiRestoreBackupRequest - */ - RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest - /* - RestoreBackupExecute executes the request - - */ - RestoreBackupExecute(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiSetImageShareRequest - */ - SetImageShare(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ImageShare - - */ - SetImageShareExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiStartServerRequest - */ - StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest - /* - StartServerExecute executes the request - - */ - StartServerExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiStopServerRequest - */ - StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest - /* - StopServerExecute executes the request - - */ - StopServerExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiUnrescueServerRequest - */ - UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest - /* - UnrescueServerExecute executes the request - - */ - UnrescueServerExecute(ctx context.Context, projectId 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 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 - /* - 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 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) - /* - 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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiUpdateBackupRequest - */ - UpdateBackup(ctx context.Context, projectId 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 backupId The identifier (ID) of a STACKIT Backup. - @return Backup - - */ - UpdateBackupExecute(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageRequest - */ - UpdateImage(ctx context.Context, projectId 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 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) - /* - 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageShareRequest - */ - UpdateImageShare(ctx context.Context, projectId 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 imageId The identifier (ID) of a STACKIT Image. - @return ImageShare - - */ - UpdateImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) - /* - 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 - */ - UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest - /* - UpdateKeyPairExecute executes the request - - @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 Keypair - - */ - UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, 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 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 - /* - 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 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) - /* - 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 publicIpId The identifier (ID) of a Public IP. - @return ApiUpdatePublicIPRequest - */ - UpdatePublicIP(ctx context.Context, projectId 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 publicIpId The identifier (ID) of a Public IP. - @return PublicIp - - */ - UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiUpdateSecurityGroupRequest - */ - UpdateSecurityGroup(ctx context.Context, projectId 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return SecurityGroup - - */ - UpdateSecurityGroupExecute(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiUpdateServerRequest - */ - UpdateServer(ctx context.Context, projectId 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 serverId The identifier (ID) of a STACKIT Server. - @return Server - - */ - UpdateServerExecute(ctx context.Context, projectId 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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiUpdateSnapshotRequest - */ - UpdateSnapshot(ctx context.Context, projectId 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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return Snapshot - - */ - UpdateSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) - /* - UpdateVirtualIP Update a virtual IP. - Update the properties of an existing virtual 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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiUpdateVirtualIPRequest - */ - UpdateVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiUpdateVirtualIPRequest - /* - UpdateVirtualIPExecute executes the request - - */ - UpdateVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiUpdateVolumeRequest - */ - UpdateVolume(ctx context.Context, projectId 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 volumeId The identifier (ID) of a STACKIT Volume. - @return Volume - - */ - UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) - /* - V1alpha1UpdateRouteOfArea Update a network route. - 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 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 ApiV1alpha1UpdateRouteOfAreaRequest - */ - V1alpha1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, routeId string) ApiV1alpha1UpdateRouteOfAreaRequest - /* - V1alpha1UpdateRouteOfAreaExecute 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 routeId The identifier (ID) of a STACKIT Route. - @return Route - - */ - V1alpha1UpdateRouteOfAreaExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) -} - -type ApiAddMemberToVirtualIPRequest interface { - // Request to add a member to a virtual IP. - AddMemberToVirtualIPPayload(addMemberToVirtualIPPayload AddMemberToVirtualIPPayload) ApiAddMemberToVirtualIPRequest - Execute() (*VirtualIp, error) -} - -type ApiAddNetworkToServerRequest interface { - Execute() error -} - -type ApiAddNicToServerRequest interface { - Execute() error -} - -type ApiAddPublicIpToServerRequest interface { - Execute() error -} - -type ApiAddSecurityGroupToServerRequest interface { - Execute() error -} - -type ApiAddServiceAccountToServerRequest interface { - Execute() (*ServiceAccountMailListResponse, error) -} - -type ApiAddVolumeToServerRequest interface { - // Request a volume attachment creation. - AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest - Execute() (*VolumeAttachment, error) -} - -type ApiCreateAffinityGroupRequest interface { - // Request a affinity group creation. - CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest - Execute() (*AffinityGroup, error) -} - -type ApiCreateBackupRequest interface { - // Request a backup creation. - CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest - Execute() (*Backup, error) -} - -type ApiCreateImageRequest interface { - // Request an image creation. - CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest - Execute() (*ImageCreateResponse, error) -} - -type ApiCreateKeyPairRequest interface { - // Request a public key import. - CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest - Execute() (*Keypair, error) -} - -type ApiCreateNetworkRequest interface { - // Request a network creation. - CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest - Execute() (*Network, error) -} - -type ApiCreateNetworkAreaRequest interface { - // Request an Area creation. - CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest - Execute() (*NetworkArea, error) -} - -type ApiCreateNetworkAreaRangeRequest interface { - // Request an addition of network ranges to an area. - CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest - Execute() (*NetworkRangeListResponse, error) -} - -type ApiCreateNetworkAreaRouteRequest interface { - // Request an addition of routes to an area. - CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest - Execute() (*RouteListResponse, error) -} - -type ApiCreateNicRequest interface { - // Request a network interface creation. - CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest - Execute() (*NIC, error) -} - -type ApiCreatePublicIPRequest interface { - // Request a public IP creation. - CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest - Execute() (*PublicIp, error) -} - -type ApiCreateSecurityGroupRequest interface { - // Request a security group creation. - CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest - Execute() (*SecurityGroup, error) -} - -type ApiCreateSecurityGroupRuleRequest interface { - // Request for a security group rule creation. - CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest - Execute() (*SecurityGroupRule, error) -} - -type ApiCreateServerRequest interface { - // Request a server creation. - CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest - Execute() (*Server, error) -} - -type ApiCreateSnapshotRequest interface { - // Request a snapshot creation. - CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest - Execute() (*Snapshot, error) -} - -type ApiCreateVirtualIPRequest interface { - // Request a virtual IP creation. - CreateVirtualIPPayload(createVirtualIPPayload CreateVirtualIPPayload) ApiCreateVirtualIPRequest - Execute() (*VirtualIp, error) -} - -type ApiCreateVolumeRequest interface { - // Request a volume creation. - CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest - Execute() (*Volume, error) -} - -type ApiDeallocateServerRequest interface { - Execute() error -} - -type ApiDeleteAffinityGroupRequest interface { - Execute() error -} - -type ApiDeleteBackupRequest interface { - // Force action. - Force(force bool) ApiDeleteBackupRequest - Execute() error -} - -type ApiDeleteImageRequest interface { - Execute() error -} - -type ApiDeleteImageShareRequest interface { - Execute() error -} - -type ApiDeleteImageShareConsumerRequest interface { - Execute() error -} - -type ApiDeleteKeyPairRequest interface { - Execute() error -} - -type ApiDeleteNetworkRequest interface { - Execute() error -} - -type ApiDeleteNetworkAreaRequest interface { - Execute() error -} - -type ApiDeleteNetworkAreaRangeRequest interface { - Execute() error -} - -type ApiDeleteNetworkAreaRouteRequest interface { - Execute() error -} - -type ApiDeleteNicRequest interface { - Execute() error -} - -type ApiDeletePublicIPRequest interface { - Execute() error -} - -type ApiDeleteSecurityGroupRequest interface { - Execute() error -} - -type ApiDeleteSecurityGroupRuleRequest interface { - Execute() error -} - -type ApiDeleteServerRequest interface { - Execute() error -} - -type ApiDeleteSnapshotRequest interface { - Execute() error -} - -type ApiDeleteVirtualIPRequest interface { - Execute() error -} - -type ApiDeleteVolumeRequest interface { - Execute() error -} - -type ApiGetAffinityGroupRequest interface { - Execute() (*AffinityGroup, error) -} - -type ApiGetAttachedVolumeRequest interface { - Execute() (*VolumeAttachment, error) -} - -type ApiGetBackupRequest interface { - Execute() (*Backup, error) -} - -type ApiGetImageRequest interface { - Execute() (*Image, error) -} - -type ApiGetImageShareRequest interface { - Execute() (*ImageShare, error) -} - -type ApiGetImageShareConsumerRequest interface { - Execute() (*ImageShareConsumer, error) -} - -type ApiGetKeyPairRequest interface { - Execute() (*Keypair, error) -} - -type ApiGetMachineTypeRequest interface { - Execute() (*MachineType, error) -} - -type ApiGetNetworkRequest interface { - Execute() (*Network, error) -} - -type ApiGetNetworkAreaRequest interface { - Execute() (*NetworkArea, error) -} - -type ApiGetNetworkAreaRangeRequest interface { - Execute() (*NetworkRange, error) -} - -type ApiGetNetworkAreaRouteRequest interface { - Execute() (*Route, error) -} - -type ApiGetNicRequest interface { - Execute() (*NIC, error) -} - -type ApiGetOrganizationRequestRequest interface { - Execute() (*Request, error) -} - -type ApiGetProjectDetailsRequest interface { - Execute() (*Project, error) -} - -type ApiGetProjectNICRequest interface { - Execute() (*NIC, error) -} - -type ApiGetProjectRequestRequest interface { - Execute() (*Request, error) -} - -type ApiGetPublicIPRequest interface { - Execute() (*PublicIp, error) -} - -type ApiGetSecurityGroupRequest interface { - Execute() (*SecurityGroup, error) -} - -type ApiGetSecurityGroupRuleRequest interface { - Execute() (*SecurityGroupRule, error) -} - -type ApiGetServerRequest interface { - // Show detailed information about server. - Details(details bool) ApiGetServerRequest - Execute() (*Server, error) -} - -type ApiGetServerConsoleRequest interface { - Execute() (*ServerConsoleUrl, error) -} - -type ApiGetServerLogRequest interface { - // Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. - Length(length int64) ApiGetServerLogRequest - Execute() (*GetServerLog200Response, error) -} - -type ApiGetSnapshotRequest interface { - Execute() (*Snapshot, error) -} - -type ApiGetVirtualIPRequest interface { - Execute() (*VirtualIp, error) -} - -type ApiGetVolumeRequest interface { - Execute() (*Volume, error) -} - -type ApiGetVolumePerformanceClassRequest interface { - Execute() (*VolumePerformanceClass, error) -} - -type ApiListAffinityGroupsRequest interface { - Execute() (*AffinityGroupListResponse, error) -} - -type ApiListAttachedVolumesRequest interface { - Execute() (*VolumeAttachmentListResponse, error) -} - -type ApiListAvailabilityZonesRequest interface { - Execute() (*AvailabilityZoneListResponse, error) -} - -type ApiListBackupsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListBackupsRequest - Execute() (*BackupListResponse, error) -} - -type ApiListImagesRequest interface { - // List all Images. - All(all bool) ApiListImagesRequest - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListImagesRequest - Execute() (*ImageListResponse, error) -} - -type ApiListKeyPairsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListKeyPairsRequest - Execute() (*KeyPairListResponse, error) -} - -type ApiListMachineTypesRequest interface { - // Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - Filter(filter string) ApiListMachineTypesRequest - Execute() (*MachineTypeListResponse, error) -} - -type ApiListNetworkAreaProjectsRequest interface { - Execute() (*ProjectListResponse, error) -} - -type ApiListNetworkAreaRangesRequest interface { - Execute() (*NetworkRangeListResponse, error) -} - -type ApiListNetworkAreaRoutesRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest - Execute() (*RouteListResponse, error) -} - -type ApiListNetworkAreasRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListNetworkAreasRequest - Execute() (*NetworkAreaListResponse, error) -} - -type ApiListNetworksRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListNetworksRequest - Execute() (*NetworkListResponse, error) -} - -type ApiListNicsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListNicsRequest - Execute() (*NICListResponse, error) -} - -type ApiListProjectNICsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListProjectNICsRequest - Execute() (*NICListResponse, error) -} - -type ApiListPublicIPsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListPublicIPsRequest - Execute() (*PublicIpListResponse, error) -} - -type ApiListPublicIpRangesRequest interface { - Execute() (*PublicNetworkListResponse, error) -} - -type ApiListQuotasRequest interface { - Execute() (*QuotaListResponse, error) -} - -type ApiListSecurityGroupRulesRequest interface { - Execute() (*SecurityGroupRuleListResponse, error) -} - -type ApiListSecurityGroupsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListSecurityGroupsRequest - Execute() (*SecurityGroupListResponse, error) -} - -type ApiListServerNicsRequest interface { - Execute() (*NICListResponse, error) -} - -type ApiListServerServiceAccountsRequest interface { - Execute() (*ServiceAccountMailListResponse, error) -} - -type ApiListServersRequest interface { - // Show detailed information about server. - Details(details bool) ApiListServersRequest - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListServersRequest - Execute() (*ServerListResponse, error) -} - -type ApiListSnapshotsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListSnapshotsRequest - Execute() (*SnapshotListResponse, error) -} - -type ApiListVirtualIPsRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListVirtualIPsRequest - Execute() (*VirtualIpListResponse, error) -} - -type ApiListVolumePerformanceClassesRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest - Execute() (*VolumePerformanceClassListResponse, error) -} - -type ApiListVolumesRequest interface { - // Filter resources by labels. - LabelSelector(labelSelector string) ApiListVolumesRequest - Execute() (*VolumeListResponse, error) -} - -type ApiPartialUpdateNetworkRequest interface { - // Request an update of a network. - PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest - Execute() error -} - -type ApiPartialUpdateNetworkAreaRequest interface { - // Request to update an Area. - PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest - Execute() (*NetworkArea, error) -} - -type ApiRebootServerRequest interface { - // Defines if it is a soft or a hard reboot. - Action(action string) ApiRebootServerRequest - Execute() error -} - -type ApiRemoveMemberFromVirtualIPRequest interface { - // Request to remove a member from a virtual IP. - RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload RemoveMemberFromVirtualIPPayload) ApiRemoveMemberFromVirtualIPRequest - Execute() (*VirtualIp, error) -} - -type ApiRemoveNetworkFromServerRequest interface { - Execute() error -} - -type ApiRemoveNicFromServerRequest interface { - Execute() error -} - -type ApiRemovePublicIpFromServerRequest interface { - Execute() error -} - -type ApiRemoveSecurityGroupFromServerRequest interface { - Execute() error -} - -type ApiRemoveServiceAccountFromServerRequest interface { - Execute() (*ServiceAccountMailListResponse, error) -} - -type ApiRemoveVolumeFromServerRequest interface { - Execute() error -} - -type ApiRescueServerRequest interface { - // Request a server rescue. - RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest - Execute() error -} - -type ApiResizeServerRequest interface { - // Request a resize of a server. - ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest - Execute() error -} - -type ApiResizeVolumeRequest interface { - // Request a volume resize. - ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest - Execute() error -} - -type ApiRestoreBackupRequest interface { - Execute() error -} - -type ApiSetImageShareRequest interface { - // Settings for an Image Share. - SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest - Execute() (*ImageShare, error) -} - -type ApiStartServerRequest interface { - Execute() error -} - -type ApiStopServerRequest interface { - Execute() error -} - -type ApiUnrescueServerRequest interface { - Execute() error -} - -type ApiUpdateAttachedVolumeRequest interface { - // Request a volume attachment update. - UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest - Execute() (*VolumeAttachment, error) -} - -type ApiUpdateBackupRequest interface { - // Request an update of a backup. - UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest - Execute() (*Backup, error) -} - -type ApiUpdateImageRequest interface { - // Request an update of an Image. - UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest - 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 - Execute() (*ImageShare, error) -} - -type ApiUpdateKeyPairRequest interface { - // Request an update of an SSH keypair. - UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest - Execute() (*Keypair, error) -} - -type ApiUpdateNicRequest interface { - // Request an update of a network interface. - UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest - Execute() (*NIC, error) -} - -type ApiUpdatePublicIPRequest interface { - // Request an update of a public IP. - UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest - Execute() (*PublicIp, error) -} - -type ApiUpdateSecurityGroupRequest interface { - // Request an update of a security group. - UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest - Execute() (*SecurityGroup, error) -} - -type ApiUpdateServerRequest interface { - // Request an update of a server. - UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest - Execute() (*Server, error) -} - -type ApiUpdateSnapshotRequest interface { - // Request an update of a snapshot. - UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest - Execute() (*Snapshot, error) -} - -type ApiUpdateVirtualIPRequest interface { - // Request an update of a virtual IP. - UpdateVirtualIPPayload(updateVirtualIPPayload UpdateVirtualIPPayload) ApiUpdateVirtualIPRequest - Execute() error -} - -type ApiUpdateVolumeRequest interface { - // Request an update of a volume. - UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest - Execute() (*Volume, error) -} - -type ApiV1alpha1UpdateRouteOfAreaRequest interface { - // Request an update of a network route. - V1alpha1UpdateRouteOfAreaPayload(v1alpha1UpdateRouteOfAreaPayload V1alpha1UpdateRouteOfAreaPayload) ApiV1alpha1UpdateRouteOfAreaRequest - Execute() (*Route, error) -} - -// DefaultApiService DefaultApi service -type DefaultApiService service - -type AddMemberToVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string - addMemberToVirtualIPPayload *AddMemberToVirtualIPPayload -} - -// Request to add a member to a virtual IP. - -func (r AddMemberToVirtualIPRequest) AddMemberToVirtualIPPayload(addMemberToVirtualIPPayload AddMemberToVirtualIPPayload) ApiAddMemberToVirtualIPRequest { - r.addMemberToVirtualIPPayload = &addMemberToVirtualIPPayload - return r -} - -func (r AddMemberToVirtualIPRequest) Execute() (*VirtualIp, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIp - ) - 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.AddMemberToVirtualIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/add-member" - 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, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -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.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.virtualIpId) < 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") - } - if strlen(r.virtualIpId) > 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") - } - if r.addMemberToVirtualIPPayload == nil { - return localVarReturnValue, fmt.Errorf("addMemberToVirtualIPPayload 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.addMemberToVirtualIPPayload - 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 -} - -/* -AddMemberToVirtualIP: Add a member to the virtual IP. - -Atomically add a member to the virtual IP. - - @param ctx context.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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiAddMemberToVirtualIPRequest -*/ -func (a *APIClient) AddMemberToVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiAddMemberToVirtualIPRequest { - return AddMemberToVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } -} - -func (a *APIClient) AddMemberToVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { - r := AddMemberToVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } - return r.Execute() -} - -type AddNetworkToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - networkId string -} - -func (r AddNetworkToServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.AddNetworkToServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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") - } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId 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 -} - -/* -AddNetworkToServer: Create and attach a network interface from the specified network. - -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 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 { - return AddNetworkToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, - } -} - -func (a *APIClient) AddNetworkToServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { - r := AddNetworkToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, - } - return r.Execute() -} - -type AddNicToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - nicId string -} - -func (r AddNicToServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPut - 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.AddNicToServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/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, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -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") - } - 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 - 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 -} - -/* -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 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 { - return AddNicToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - nicId: nicId, - } -} - -func (a *APIClient) AddNicToServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { - r := AddNicToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - nicId: nicId, - } - return r.Execute() -} - -type AddPublicIpToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - publicIpId string -} - -func (r AddPublicIpToServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPut - 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.AddPublicIpToServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - 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, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -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") - } - if strlen(r.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId 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 -} - -/* -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 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 { - return AddPublicIpToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - publicIpId: publicIpId, - } -} - -func (a *APIClient) AddPublicIpToServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { - r := AddPublicIpToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - publicIpId: publicIpId, - } - return r.Execute() -} - -type AddSecurityGroupToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - securityGroupId string -} - -func (r AddSecurityGroupToServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPut - 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.AddSecurityGroupToServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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") - } - 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiAddSecurityGroupToServerRequest -*/ -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) AddSecurityGroupToServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { - r := AddSecurityGroupToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type AddServiceAccountToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - serviceAccountMail string -} - -func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - 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.AddServiceAccountToServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.serviceAccountMail) > 255 { - return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 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 == 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")) - 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @param serviceAccountMail The e-mail address of a service account. - @return ApiAddServiceAccountToServerRequest -*/ -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) 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, - } - 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 -} - -func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { - var ( - localVarHTTPMethod = http.MethodPut - 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.AddVolumeToServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{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, "{"+"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{"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.addVolumeToServerPayload - 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 == 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")) - 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiAddVolumeToServerRequest -*/ -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) 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, - } - 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 -} - -func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { - var ( - localVarHTTPMethod = http.MethodPost - 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.CreateAffinityGroup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups" - 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.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.createAffinityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createAffinityGroupPayload 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.createAffinityGroupPayload - 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 -} - -/* -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. - @return ApiCreateAffinityGroupRequest -*/ -func (a *APIClient) CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest { - return CreateAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId string) (*AffinityGroup, error) { - r := CreateAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createBackupPayload *CreateBackupPayload -} - -// Request a backup creation. - -func (r CreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { - r.createBackupPayload = &createBackupPayload - return r -} - -func (r CreateBackupRequest) Execute() (*Backup, error) { - var ( - localVarHTTPMethod = http.MethodPost - 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.CreateBackup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups" - 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.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 - 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.createBackupPayload - 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 -} - -/* -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. - @return ApiCreateBackupRequest -*/ -func (a *APIClient) CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest { - return CreateBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string) (*Backup, error) { - r := CreateBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createImagePayload *CreateImagePayload -} - -// Request an image creation. - -func (r CreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { - r.createImagePayload = &createImagePayload - return r -} - -func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateImage") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" - 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.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.createImagePayload == nil { - return localVarReturnValue, fmt.Errorf("createImagePayload 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.createImagePayload - 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 == 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")) - 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 -} - -/* -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. - @return ApiCreateImageRequest -*/ -func (a *APIClient) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { - return CreateImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) { - r := CreateImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - createKeyPairPayload *CreateKeyPairPayload -} - -// Request a public key import. - -func (r CreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { - r.createKeyPairPayload = &createKeyPairPayload - return r -} - -func (r CreateKeyPairRequest) Execute() (*Keypair, error) { - var ( - localVarHTTPMethod = http.MethodPost - 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.CreateKeyPair") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/keypairs" - - 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") - } - - // 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.createKeyPairPayload - 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 == 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")) - 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 -} - -/* -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. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateKeyPairRequest -*/ -func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { - return CreateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - } -} - -func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { - r := CreateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - } - return r.Execute() -} - -type CreateNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createNetworkPayload *CreateNetworkPayload -} - -// Request a network creation. - -func (r CreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { - r.createNetworkPayload = &createNetworkPayload - return r -} - -func (r CreateNetworkRequest) Execute() (*Network, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateNetwork") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" - 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.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.createNetworkPayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkPayload 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.createNetworkPayload - 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 == 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")) - 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 -} - -/* -CreateNetwork: Create new network. - -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 projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateNetworkRequest -*/ -func (a *APIClient) CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest { - return CreateNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string) (*Network, error) { - r := CreateNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - createNetworkAreaPayload *CreateNetworkAreaPayload -} - -// Request an Area creation. - -func (r CreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { - r.createNetworkAreaPayload = &createNetworkAreaPayload - return r -} - -func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateNetworkArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -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 r.createNetworkAreaPayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkAreaPayload 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.createNetworkAreaPayload - 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 -} - -/* -CreateNetworkArea: Create new network area in an organization. - -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. - @return ApiCreateNetworkAreaRequest -*/ -func (a *APIClient) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { - return CreateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - } -} - -func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) { - r := CreateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - } - return r.Execute() -} - -type CreateNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - createNetworkAreaRangePayload *CreateNetworkAreaRangePayload -} - -// Request an addition of network ranges to an area. - -func (r CreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { - r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload - return r -} - -func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateNetworkAreaRange") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") - } - if r.createNetworkAreaRangePayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkAreaRangePayload 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.createNetworkAreaRangePayload - 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 == 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")) - 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 -} - -/* -CreateNetworkAreaRange: Create new network range in a network area. - -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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiCreateNetworkAreaRangeRequest -*/ -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) CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { - r := CreateNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } - return r.Execute() -} - -type CreateNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload -} - -// Request an addition of routes to an area. - -func (r CreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { - r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload - return r -} - -func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateNetworkAreaRoute") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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.createNetworkAreaRoutePayload - 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 == 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")) - 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 -} - -/* -CreateNetworkAreaRoute: Create new network routes. - -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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiCreateNetworkAreaRouteRequest -*/ -func (a *APIClient) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest { - return CreateNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } -} - -func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { - r := CreateNetworkAreaRouteRequest{ - 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 -} - -// Request a network interface creation. - -func (r CreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { - r.createNicPayload = &createNicPayload - return r -} - -func (r CreateNicRequest) Execute() (*NIC, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateNic") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.createNicPayload == nil { - return localVarReturnValue, fmt.Errorf("createNicPayload 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.createNicPayload - 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 == 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")) - 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 -} - -/* -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 networkId The identifier (ID) of a STACKIT Network. - @return ApiCreateNicRequest -*/ -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) CreateNicExecute(ctx context.Context, projectId string, networkId string) (*NIC, error) { - r := CreateNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type CreatePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createPublicIPPayload *CreatePublicIPPayload -} - -// Request a public IP creation. - -func (r CreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { - r.createPublicIPPayload = &createPublicIPPayload - return r -} - -func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreatePublicIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" - 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.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.createPublicIPPayload == nil { - return localVarReturnValue, fmt.Errorf("createPublicIPPayload 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.createPublicIPPayload - 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 == 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")) - 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 -} - -/* -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. - @return ApiCreatePublicIPRequest -*/ -func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { - return CreatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) { - r := CreatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createSecurityGroupPayload *CreateSecurityGroupPayload -} - -// Request a security group creation. - -func (r CreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { - r.createSecurityGroupPayload = &createSecurityGroupPayload - return r -} - -func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateSecurityGroup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" - 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.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.createSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createSecurityGroupPayload 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.createSecurityGroupPayload - 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 -} - -/* -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. - @return ApiCreateSecurityGroupRequest -*/ -func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { - return CreateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) { - r := CreateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - createSecurityGroupRulePayload *CreateSecurityGroupRulePayload -} - -// Request for a security group rule creation. - -func (r CreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { - r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload - return r -} - -func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateSecurityGroupRule") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } - 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 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) - 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.createSecurityGroupRulePayload - 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 -} - -/* -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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiCreateSecurityGroupRuleRequest -*/ -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) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) { - r := CreateSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type CreateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createServerPayload *CreateServerPayload -} - -// 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 - 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.CreateServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" - 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.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.createServerPayload == nil { - return localVarReturnValue, fmt.Errorf("createServerPayload 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.createServerPayload - 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 -} - -/* -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. - @return ApiCreateServerRequest -*/ -func (a *APIClient) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { - return CreateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) (*Server, error) { - r := CreateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateSnapshotRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createSnapshotPayload *CreateSnapshotPayload -} - -// 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.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateSnapshot") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots" - 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.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.createSnapshotPayload == nil { - return localVarReturnValue, fmt.Errorf("createSnapshotPayload 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.createSnapshotPayload - 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 -} - -/* -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. - @return ApiCreateSnapshotRequest -*/ -func (a *APIClient) CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest { - return CreateSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string) (*Snapshot, error) { - r := CreateSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type CreateVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - createVirtualIPPayload *CreateVirtualIPPayload -} - -// Request a virtual IP creation. - -func (r CreateVirtualIPRequest) CreateVirtualIPPayload(createVirtualIPPayload CreateVirtualIPPayload) ApiCreateVirtualIPRequest { - r.createVirtualIPPayload = &createVirtualIPPayload - return r -} - -func (r CreateVirtualIPRequest) Execute() (*VirtualIp, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIp - ) - 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.CreateVirtualIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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.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.createVirtualIPPayload == nil { - return localVarReturnValue, fmt.Errorf("createVirtualIPPayload 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.createVirtualIPPayload - 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 == 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")) - 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 -} - -/* -CreateVirtualIP: Create new virtual IP. - -Create a new virtual 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 networkId The identifier (ID) of a STACKIT Network. - @return ApiCreateVirtualIPRequest -*/ -func (a *APIClient) CreateVirtualIP(ctx context.Context, projectId string, networkId string) ApiCreateVirtualIPRequest { - return CreateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } -} - -func (a *APIClient) CreateVirtualIPExecute(ctx context.Context, projectId string, networkId string) (*VirtualIp, error) { - r := CreateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type CreateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createVolumePayload *CreateVolumePayload -} - -// Request a volume creation. - -func (r CreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { - r.createVolumePayload = &createVolumePayload - return r -} - -func (r CreateVolumeRequest) Execute() (*Volume, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - 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.CreateVolume") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" - 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.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.createVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("createVolumePayload 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.createVolumePayload - 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 -} - -/* -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. - @return ApiCreateVolumeRequest -*/ -func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { - return CreateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { - r := CreateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type DeallocateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r DeallocateServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.DeallocateServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 == 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiDeallocateServerRequest -*/ -func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { - return DeallocateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { - r := DeallocateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type DeleteAffinityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - affinityGroupId string -} - -func (r DeleteAffinityGroupRequest) 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.DeleteAffinityGroup") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.affinityGroupId) < 36 { - return fmt.Errorf("affinityGroupId must have at least 36 elements") - } - if strlen(r.affinityGroupId) > 36 { - return 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 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 -} - -/* -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 affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return ApiDeleteAffinityGroupRequest -*/ -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) DeleteAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) error { - r := DeleteAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, - } - return r.Execute() -} - -type DeleteBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - backupId string - force *bool -} - -// 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{} - 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.DeleteBackup") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - 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{} - - // 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 -} - -/* -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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiDeleteBackupRequest -*/ -func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest { - return DeleteBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } -} - -func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, backupId string) error { - r := DeleteBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } - return r.Execute() -} - -type DeleteImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string -} - -func (r DeleteImageRequest) 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.DeleteImage") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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 -} - -/* -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 imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageRequest -*/ -func (a *APIClient) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { - return DeleteImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } -} - -func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, imageId string) error { - r := DeleteImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() -} - -type DeleteImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string -} - -func (r DeleteImageShareRequest) 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.DeleteImageShare") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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 -} - -/* -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 imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageShareRequest -*/ -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) DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error { - r := DeleteImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() -} - -type DeleteImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - consumerProjectId string -} - -func (r DeleteImageShareConsumerRequest) 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.DeleteImageShareConsumer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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.consumerProjectId) > 36 { - return 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 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 -} - -/* -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 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) 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) DeleteImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) error { - r := DeleteImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, - } - return r.Execute() -} - -type DeleteKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string -} - -func (r DeleteKeyPairRequest) 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.DeleteKeyPair") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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 fmt.Errorf("keypairName must have less than 127 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 -} - -/* -DeleteKeyPair: Delete an SSH keypair. - -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 keypairName The name of an SSH keypair. - @return ApiDeleteKeyPairRequest -*/ -func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { - return DeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, - } -} - -func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { - r := DeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, - } - return r.Execute() -} - -type DeleteNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string -} - -func (r DeleteNetworkRequest) 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.DeleteNetwork") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.networkId) > 36 { - return fmt.Errorf("networkId 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 -} - -/* -DeleteNetwork: Delete network. - -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 projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiDeleteNetworkRequest -*/ -func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest { - return DeleteNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } -} - -func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, networkId string) error { - r := DeleteNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type DeleteNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string -} - -func (r DeleteNetworkAreaRequest) 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.DeleteNetworkArea") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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") - } - - // 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 -} - -/* -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. - - @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 -*/ -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) DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error { - r := DeleteNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } - return r.Execute() -} - -type DeleteNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - networkRangeId string -} - -func (r DeleteNetworkAreaRangeRequest) 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.DeleteNetworkAreaRange") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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") - } - - // 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 -} - -/* -DeleteNetworkAreaRange: Delete a network range. - -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 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 -*/ -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) DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) error { - r := DeleteNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - networkRangeId: networkRangeId, - } - return r.Execute() -} - -type DeleteNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string -} - -func (r DeleteNetworkAreaRouteRequest) 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.DeleteNetworkAreaRoute") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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 -} - -/* -DeleteNetworkAreaRoute: Delete a network route. - -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 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 -*/ -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) DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) error { - r := DeleteNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, - } - return r.Execute() -} - -type DeleteNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string -} - -func (r DeleteNicRequest) 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.DeleteNic") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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 -} - -/* -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 networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiDeleteNicRequest -*/ -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) DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error { - r := DeleteNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, - } - return r.Execute() -} - -type DeletePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string -} - -func (r DeletePublicIPRequest) 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.DeletePublicIP") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId 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 -} - -/* -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 publicIpId The identifier (ID) of a Public IP. - @return ApiDeletePublicIPRequest -*/ -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) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { - r := DeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, - } - return r.Execute() -} - -type DeleteSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiDeleteSecurityGroupRequest -*/ -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) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { - r := DeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type DeleteSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 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, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { - return DeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, - } -} - -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, - } - return r.Execute() -} - -type DeleteServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/projects/{projectId}/servers/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest -*/ -func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { - return DeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { - r := DeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type DeleteSnapshotRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiDeleteSnapshotRequest -*/ -func (a *APIClient) DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest { - return DeleteSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, - } -} - -func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, snapshotId string) error { - r := DeleteSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, - } - return r.Execute() -} - -type DeleteVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string -} - -func (r DeleteVirtualIPRequest) 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.DeleteVirtualIP") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" - 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, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -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.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.virtualIpId) < 36 { - return fmt.Errorf("virtualIpId must have at least 36 elements") - } - if strlen(r.virtualIpId) > 36 { - return fmt.Errorf("virtualIpId 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 -} - -/* -DeleteVirtualIP: Delete a virtual IP. - -Delete a virtual 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiDeleteVirtualIPRequest -*/ -func (a *APIClient) DeleteVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiDeleteVirtualIPRequest { - return DeleteVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } -} - -func (a *APIClient) DeleteVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) error { - r := DeleteVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } - return r.Execute() -} - -type DeleteVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest -*/ -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) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := DeleteVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, - } - return r.Execute() -} - -type GetAffinityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return ApiGetAffinityGroupRequest -*/ -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) GetAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) (*AffinityGroup, error) { - r := GetAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, - } - return r.Execute() -} - -type GetAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{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, "{"+"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 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, serverId string, volumeId string) ApiGetAttachedVolumeRequest { - return GetAttachedVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, - } -} - -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, - } - return r.Execute() -} - -type GetBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/projects/{projectId}/backups/{backupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiGetBackupRequest -*/ -func (a *APIClient) GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest { - return GetBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } -} - -func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { - r := GetBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } - return r.Execute() -} - -type GetImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageRequest -*/ -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) GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := GetImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() -} - -type GetImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageShareRequest -*/ -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) GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := GetImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() -} - -type GetImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId 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 + "/v1alpha1/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) - - 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 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, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { - return GetImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, - } -} - -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, - } - return r.Execute() -} - -type GetKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string -} - -func (r GetKeyPairRequest) Execute() (*Keypair, error) { - var ( - localVarHTTPMethod = http.MethodGet - 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.GetKeyPair") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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") - } - - // 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 -} - -/* -GetKeyPair: Get SSH keypair details. - -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 keypairName The name of an SSH keypair. - @return ApiGetKeyPairRequest -*/ -func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { - return GetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, - } -} - -func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { - r := GetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, - } - return r.Execute() -} - -type GetMachineTypeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - machineType string -} - -func (r GetMachineTypeRequest) Execute() (*MachineType, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetMachineType") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types/{machineType}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(r.machineType, "machineType")), -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.machineType) > 127 { - return localVarReturnValue, fmt.Errorf("machineType must have less than 127 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 -} - -/* -GetMachineType: Get details about a machine type. - -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 machineType STACKIT machine type Name. - @return ApiGetMachineTypeRequest -*/ -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) GetMachineTypeExecute(ctx context.Context, projectId string, machineType string) (*MachineType, error) { - r := GetMachineTypeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - machineType: machineType, - } - return r.Execute() -} - -type GetNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string -} - -func (r GetNetworkRequest) Execute() (*Network, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetNetwork") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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") - } - - // 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 -} - -/* -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 networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest -*/ -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) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { - r := GetNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type GetNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string -} - -func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetNetworkArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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{} - - // 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 -} - -/* -GetNetworkArea: Get details about a network area. - -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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiGetNetworkAreaRequest -*/ -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) 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 GetNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - networkRangeId string -} - -func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetNetworkAreaRange") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId 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.networkRangeId) > 36 { - return localVarReturnValue, fmt.Errorf("networkRangeId 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 -} - -/* -GetNetworkAreaRange: Get details about a network range. - -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 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 -*/ -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) 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, - } - return r.Execute() -} - -type GetNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string -} - -func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetNetworkAreaRoute") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 - 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 -} - -/* -GetNetworkAreaRoute: Get details about a network route. - -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 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, - } -} - -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, - } - return r.Execute() -} - -type GetNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string -} - -func (r GetNicRequest) Execute() (*NIC, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetNic") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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 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 - 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 -} - -/* -GetNic: Get details about a network interface of a network. - -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 networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiGetNicRequest -*/ -func (a *APIClient) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { - return GetNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, - } -} - -func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := GetNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, - } - return r.Execute() -} - -type GetOrganizationRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - requestId string -} - -func (r GetOrganizationRequestRequest) Execute() (*Request, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetOrganizationRequest") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") - } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId 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 -} - -/* -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. - - @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 -*/ -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) 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 GetProjectDetailsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r GetProjectDetailsRequest) Execute() (*Project, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetProjectDetails") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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{} - - // 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 -} - -/* -GetProjectDetails: Get project details. - -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 projectId The identifier (ID) of a STACKIT Project. - @return ApiGetProjectDetailsRequest -*/ -func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { - return GetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { - r := GetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type GetProjectNICRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - nicId string -} - -func (r GetProjectNICRequest) Execute() (*NIC, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetProjectNIC") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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.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.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 - 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 -} - -/* -GetProjectNIC: Get details about a network interface of a project. - -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 projectId The identifier (ID) of a STACKIT Project. - @param nicId The identifier (ID) of a network interface. - @return ApiGetProjectNICRequest -*/ -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) GetProjectNICExecute(ctx context.Context, projectId string, nicId string) (*NIC, error) { - r := GetProjectNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - nicId: nicId, - } - return r.Execute() -} - -type GetProjectRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - requestId string -} - -func (r GetProjectRequestRequest) Execute() (*Request, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetProjectRequest") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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.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.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId 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 -} - -/* -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 requestId The identifier (ID) of a STACKIT Request. - @return ApiGetProjectRequestRequest -*/ -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) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { - r := GetProjectRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - requestId: requestId, - } - return r.Execute() -} - -type GetPublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string -} - -func (r GetPublicIPRequest) Execute() (*PublicIp, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetPublicIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId 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 -} - -/* -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 publicIpId The identifier (ID) of a Public IP. - @return ApiGetPublicIPRequest -*/ -func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { - return GetPublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, - } -} - -func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := GetPublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, - } - return r.Execute() -} - -type GetSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string -} - -func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetSecurityGroup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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") - } - - // 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 -} - -/* -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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiGetSecurityGroupRequest -*/ -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) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := GetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type GetSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string -} - -func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetSecurityGroupRule") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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.securityGroupRuleId) > 36 { - return localVarReturnValue, 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 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 -} - -/* -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 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) 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) 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, - } - return r.Execute() -} - -type GetServerRequest 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 -} - -func (r GetServerRequest) Execute() (*Server, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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 r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest -*/ -func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { - return GetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := GetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type GetServerConsoleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetServerConsole") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest -*/ -func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { - return GetServerConsoleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { - r := GetServerConsoleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - 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 -} - -func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetServerLog") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/log" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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 r.length != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "") - } - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerLogRequest -*/ -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) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { - r := GetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type GetSnapshotRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - snapshotId string -} - -func (r GetSnapshotRequest) Execute() (*Snapshot, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetSnapshot") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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.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{} - - // 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 -} - -/* -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 snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiGetSnapshotRequest -*/ -func (a *APIClient) GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest { - return GetSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, - } -} - -func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { - r := GetSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, - } - return r.Execute() -} - -type GetVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string -} - -func (r GetVirtualIPRequest) Execute() (*VirtualIp, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIp - ) - 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.GetVirtualIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" - 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, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -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.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.virtualIpId) < 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") - } - if strlen(r.virtualIpId) > 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId 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 -} - -/* -GetVirtualIP: Get details about a virtual IP. - -Get details about a virtual 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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiGetVirtualIPRequest -*/ -func (a *APIClient) GetVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiGetVirtualIPRequest { - return GetVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } -} - -func (a *APIClient) GetVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { - r := GetVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } - return r.Execute() -} - -type GetVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string -} - -func (r GetVolumeRequest) Execute() (*Volume, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetVolume") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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 -} - -/* -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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetVolumeRequest -*/ -func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { - return GetVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, - } -} - -func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := GetVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, - } - return r.Execute() -} - -type GetVolumePerformanceClassRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumePerformanceClass string -} - -func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.GetVolumePerformanceClass") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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{} - - // 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 -} - -/* -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 volumePerformanceClass The name of a STACKIT Volume performance class. - @return ApiGetVolumePerformanceClassRequest -*/ -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) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { - r := GetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, - } - return r.Execute() -} - -type ListAffinityGroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListAffinityGroups") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups" - 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.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{} - - // 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 == 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")) - 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 -} - -/* -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. - @return ApiListAffinityGroupsRequest -*/ -func (a *APIClient) ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest { - return ListAffinityGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId string) (*AffinityGroupListResponse, error) { - r := ListAffinityGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListAttachedVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListAttachedVolumes") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListAttachedVolumesRequest -*/ -func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { - return ListAttachedVolumesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) { - r := ListAttachedVolumesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type ListAvailabilityZonesRequest struct { - ctx context.Context - apiService *DefaultApiService -} - -func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListAvailabilityZones") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/availability-zones" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 -} - -/* -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(). - @return ApiListAvailabilityZonesRequest -*/ -func (a *APIClient) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { - return ListAvailabilityZonesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } -} - -func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) { - r := ListAvailabilityZonesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } - return r.Execute() -} - -type ListBackupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// 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 *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.ListBackups") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListBackupsRequest -*/ -func (a *APIClient) ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest { - return ListBackupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string) (*BackupListResponse, error) { - r := ListBackupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - 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 -} - -func (r ListImagesRequest) Execute() (*ImageListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListImages") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" - 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.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.all != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "") - } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListImagesRequest -*/ -func (a *APIClient) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { - return ListImagesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) { - r := ListImagesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - 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 -} - -func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListKeyPairs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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{} - - // 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 -} - -/* -ListKeyPairs: List all SSH keypairs for the requesting user. - -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 ApiListKeyPairsRequest -*/ -func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { - return ListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, - } -} - -func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { - r := ListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, - } - 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 -} - -func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListMachineTypes") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types" - 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.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.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") - } - // 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 -} - -/* -ListMachineTypes: List all machine types available for 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 ApiListMachineTypesRequest -*/ -func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { - return ListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) { - r := ListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListNetworkAreaProjectsRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string -} - -func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListNetworkAreaProjects") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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{} - - // 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 -} - -/* -ListNetworkAreaProjects: List all projects using a network area. - -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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaProjectsRequest -*/ -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) 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 ListNetworkAreaRangesRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string -} - -func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListNetworkAreaRanges") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId 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 -} - -/* -ListNetworkAreaRanges: List all network ranges in a network area. - -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(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaRangesRequest -*/ -func (a *APIClient) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest { - return ListNetworkAreaRangesRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } -} - -func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { - r := ListNetworkAreaRangesRequest{ - 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 -} - -// 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 *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.ListNetworkAreaRoutes") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.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{} - - // 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 -} - -/* -ListNetworkAreaRoutes: List all network routes in 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 ApiListNetworkAreaRoutesRequest -*/ -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) ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { - r := ListNetworkAreaRoutesRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } - return r.Execute() -} - -type ListNetworkAreasRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - labelSelector *string -} - -// 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 *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.ListNetworkAreas") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -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 r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -ListNetworkAreas: List all network areas in an organization. - -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. - @return ApiListNetworkAreasRequest -*/ -func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { - return ListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - } -} - -func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { - r := ListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - } - return r.Execute() -} - -type ListNetworksRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListNetworks") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -ListNetworks: List all networks inside a project. - -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 projectId The identifier (ID) of a STACKIT Project. - @return ApiListNetworksRequest -*/ -func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { - return ListNetworksRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { - r := ListNetworksRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - 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 -} - -func (r ListNicsRequest) Execute() (*NICListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListNics") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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{} - - // 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 -} - -/* -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 networkId The identifier (ID) of a STACKIT Network. - @return ApiListNicsRequest -*/ -func (a *APIClient) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { - return ListNicsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } -} - -func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { - r := ListNicsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type ListProjectNICsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListProjectNICs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/nics" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListProjectNICsRequest -*/ -func (a *APIClient) ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest { - return ListProjectNICsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListProjectNICsExecute(ctx context.Context, projectId string) (*NICListResponse, error) { - r := ListProjectNICsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListPublicIPsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListPublicIPs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -ListPublicIPs: List all public IPs 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 ApiListPublicIPsRequest -*/ -func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { - return ListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { - r := ListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListPublicIpRangesRequest struct { - ctx context.Context - apiService *DefaultApiService -} - -func (r ListPublicIpRangesRequest) Execute() (*PublicNetworkListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListPublicIpRanges") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/networks/public-ip-ranges" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 -} - -/* -ListPublicIpRanges: List all public IP ranges. - -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(). - @return ApiListPublicIpRangesRequest -*/ -func (a *APIClient) ListPublicIpRanges(ctx context.Context) ApiListPublicIpRangesRequest { - return ListPublicIpRangesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } -} - -func (a *APIClient) ListPublicIpRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { - r := ListPublicIpRangesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } - return r.Execute() -} - -type ListQuotasRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListQuotas") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/quotas" - 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.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{} - - // 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 -} - -/* -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. - @return ApiListQuotasRequest -*/ -func (a *APIClient) ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest { - return ListQuotasRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string) (*QuotaListResponse, error) { - r := ListQuotasRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListSecurityGroupRulesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string -} - -func (r ListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SecurityGroupRuleListResponse - ) - 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.ListSecurityGroupRules") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } - 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") - } - - // 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 -} - -/* -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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiListSecurityGroupRulesRequest -*/ -func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { - return ListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - } -} - -func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { - r := ListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type ListSecurityGroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SecurityGroupListResponse - ) - 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.ListSecurityGroups") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListSecurityGroupsRequest -*/ -func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { - return ListSecurityGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { - r := ListSecurityGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListServerNicsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r ListServerNicsRequest) Execute() (*NICListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListServerNics") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerNicsRequest -*/ -func (a *APIClient) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { - return ListServerNicsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) ListServerNicsExecute(ctx context.Context, projectId string, serverId string) (*NICListResponse, error) { - r := ListServerNicsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type ListServerServiceAccountsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r ListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - 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.ListServerServiceAccounts") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - - // 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerServiceAccountsRequest -*/ -func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { - return ListServerServiceAccountsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, serverId string) (*ServiceAccountMailListResponse, error) { - r := ListServerServiceAccountsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type ListServersRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - details *bool - labelSelector *string -} - -// Show detailed information about server. - -func (r ListServersRequest) Details(details bool) ApiListServersRequest { - r.details = &details - return r -} - -// Filter resources by labels. - -func (r ListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListServersRequest) Execute() (*ServerListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ServerListResponse - ) - 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.ListServers") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" - 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.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.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListServersRequest -*/ -func (a *APIClient) ListServers(ctx context.Context, projectId string) ApiListServersRequest { - return ListServersRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) { - r := ListServersRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListSnapshotsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListSnapshotsRequest) LabelSelector(labelSelector string) ApiListSnapshotsRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SnapshotListResponse - ) - 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.ListSnapshots") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -ListSnapshots: 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 -*/ -func (a *APIClient) ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest { - return ListSnapshotsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListSnapshotsExecute(ctx context.Context, projectId string) (*SnapshotListResponse, error) { - r := ListSnapshotsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListVirtualIPsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListVirtualIPsRequest) LabelSelector(labelSelector string) ApiListVirtualIPsRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIpListResponse - ) - 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.ListVirtualIPs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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.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{} - - // 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 -} - -/* -ListVirtualIPs: List all virtual IPs inside a project. - -Get a list of all virtual 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. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiListVirtualIPsRequest -*/ -func (a *APIClient) ListVirtualIPs(ctx context.Context, projectId string, networkId string) ApiListVirtualIPsRequest { - return ListVirtualIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } -} - -func (a *APIClient) ListVirtualIPsExecute(ctx context.Context, projectId string, networkId string) (*VirtualIpListResponse, error) { - r := ListVirtualIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type ListVolumePerformanceClassesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VolumePerformanceClassListResponse - ) - 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.ListVolumePerformanceClasses") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListVolumePerformanceClassesRequest -*/ -func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { - return ListVolumePerformanceClassesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string) (*VolumePerformanceClassListResponse, error) { - r := ListVolumePerformanceClassesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ListVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ListVolumesRequest) Execute() (*VolumeListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VolumeListResponse - ) - 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.ListVolumes") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" - 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.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.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } - // 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 -} - -/* -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. - @return ApiListVolumesRequest -*/ -func (a *APIClient) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { - return ListVolumesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string) (*VolumeListResponse, error) { - r := ListVolumesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type PartialUpdateNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - partialUpdateNetworkPayload *PartialUpdateNetworkPayload -} - -// Request an update of a network. - -func (r PartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { - r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload - return r -} - -func (r PartialUpdateNetworkRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPatch - 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.PartialUpdateNetwork") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") - } - if r.partialUpdateNetworkPayload == nil { - return fmt.Errorf("partialUpdateNetworkPayload 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.partialUpdateNetworkPayload - 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 -} - -/* -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 networkId The identifier (ID) of a STACKIT Network. - @return ApiPartialUpdateNetworkRequest -*/ -func (a *APIClient) PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest { - return PartialUpdateNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } -} - -func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId string, networkId string) error { - r := PartialUpdateNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - } - return r.Execute() -} - -type PartialUpdateNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload -} - -// Request to update an Area. - -func (r PartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { - r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload - return r -} - -func (r PartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - 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.PartialUpdateNetworkArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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.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 r.partialUpdateNetworkAreaPayload == nil { - return localVarReturnValue, fmt.Errorf("partialUpdateNetworkAreaPayload 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.partialUpdateNetworkAreaPayload - 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 -} - -/* -PartialUpdateNetworkArea: Update network area settings. - -Update the settings of 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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiPartialUpdateNetworkAreaRequest -*/ -func (a *APIClient) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { - return PartialUpdateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } -} - -func (a *APIClient) PartialUpdateNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { - r := PartialUpdateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - } - return r.Execute() -} - -type RebootServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - action *string -} - -// Defines if it is a soft or a hard reboot. - -func (r RebootServerRequest) Action(action string) ApiRebootServerRequest { - r.action = &action - return r -} - -func (r RebootServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.RebootServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } - - if r.action != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "") - } - // 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 -} - -/* -RebootServer: Reboot the server. - -Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. - - @param ctx context.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 ApiRebootServerRequest -*/ -func (a *APIClient) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { - return RebootServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, serverId string) error { - r := RebootServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type RemoveMemberFromVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string - removeMemberFromVirtualIPPayload *RemoveMemberFromVirtualIPPayload -} - -// Request to remove a member from a virtual IP. - -func (r RemoveMemberFromVirtualIPRequest) RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload RemoveMemberFromVirtualIPPayload) ApiRemoveMemberFromVirtualIPRequest { - r.removeMemberFromVirtualIPPayload = &removeMemberFromVirtualIPPayload - return r -} - -func (r RemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIp - ) - 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.RemoveMemberFromVirtualIP") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" - 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, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -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.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.virtualIpId) < 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") - } - if strlen(r.virtualIpId) > 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") - } - if r.removeMemberFromVirtualIPPayload == nil { - return localVarReturnValue, fmt.Errorf("removeMemberFromVirtualIPPayload 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.removeMemberFromVirtualIPPayload - 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 -} - -/* -RemoveMemberFromVirtualIP: Remove a member from the virtual IP. - -Atomically remove a member from the virtual IP. - - @param ctx context.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 virtualIpId The identifier (ID) of a Virtual IP. - @return ApiRemoveMemberFromVirtualIPRequest -*/ -func (a *APIClient) RemoveMemberFromVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiRemoveMemberFromVirtualIPRequest { - return RemoveMemberFromVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } -} - -func (a *APIClient) RemoveMemberFromVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { - r := RemoveMemberFromVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, - } - return r.Execute() -} - -type RemoveNetworkFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - networkId string -} - -func (r RemoveNetworkFromServerRequest) 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.RemoveNetworkFromServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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") - } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId 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 -} - -/* -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 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 { - return RemoveNetworkFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, - } -} - -func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { - r := RemoveNetworkFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, - } - return r.Execute() -} - -type RemoveNicFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - nicId string -} - -func (r RemoveNicFromServerRequest) 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.RemoveNicFromServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/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, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -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") - } - 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 - 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 -} - -/* -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 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 { - return RemoveNicFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - nicId: nicId, - } -} - -func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { - r := RemoveNicFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - nicId: nicId, - } - return r.Execute() -} - -type RemovePublicIpFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - publicIpId string -} - -func (r RemovePublicIpFromServerRequest) 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.RemovePublicIpFromServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - 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, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -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") - } - if strlen(r.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId 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 -} - -/* -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 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 { - return RemovePublicIpFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - publicIpId: publicIpId, - } -} - -func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { - r := RemovePublicIpFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - publicIpId: publicIpId, - } - return r.Execute() -} - -type RemoveSecurityGroupFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - securityGroupId string -} - -func (r RemoveSecurityGroupFromServerRequest) 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.RemoveSecurityGroupFromServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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") - } - 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 -} - -/* -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 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 { - return RemoveSecurityGroupFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, - } -} - -func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { - r := RemoveSecurityGroupFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, - } - return r.Execute() -} - -type RemoveServiceAccountFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - serviceAccountMail string -} - -func (r RemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - 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.RemoveServiceAccountFromServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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.serviceAccountMail) > 255 { - return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 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 == 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")) - 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 -} - -/* -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 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 { - return RemoveServiceAccountFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, - } -} - -func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { - r := RemoveServiceAccountFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, - } - return r.Execute() -} - -type RemoveVolumeFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string -} - -func (r RemoveVolumeFromServerRequest) 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.RemoveVolumeFromServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{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, "{"+"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.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") - } - 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 -} - -/* -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 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 { - return RemoveVolumeFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, - } -} - -func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) error { - r := RemoveVolumeFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, - } - return r.Execute() -} - -type RescueServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - rescueServerPayload *RescueServerPayload -} - -// Request a server rescue. - -func (r RescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { - r.rescueServerPayload = &rescueServerPayload - return r -} - -func (r RescueServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.RescueServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } - if r.rescueServerPayload == nil { - return fmt.Errorf("rescueServerPayload 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.rescueServerPayload - 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiRescueServerRequest -*/ -func (a *APIClient) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { - return RescueServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, serverId string) error { - r := RescueServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type ResizeServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - resizeServerPayload *ResizeServerPayload -} - -// Request a resize of a server. - -func (r ResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { - r.resizeServerPayload = &resizeServerPayload - return r -} - -func (r ResizeServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.ResizeServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } - if r.resizeServerPayload == nil { - return fmt.Errorf("resizeServerPayload 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.resizeServerPayload - 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiResizeServerRequest -*/ -func (a *APIClient) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { - return ResizeServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ResizeServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type ResizeVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string - resizeVolumePayload *ResizeVolumePayload -} - -// Request a volume resize. - -func (r ResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { - r.resizeVolumePayload = &resizeVolumePayload - return r -} - -func (r ResizeVolumeRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.ResizeVolume") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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{"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.resizeVolumePayload - 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 -} - -/* -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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiResizeVolumeRequest -*/ -func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { - return ResizeVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, - } -} - -func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ResizeVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, - } - return r.Execute() -} - -type RestoreBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - backupId string -} - -func (r RestoreBackupRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.RestoreBackup") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 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") - } - if strlen(r.backupId) > 36 { - return 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 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 -} - -/* -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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiRestoreBackupRequest -*/ -func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest { - return RestoreBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } -} - -func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, backupId string) error { - r := RestoreBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, - } - return r.Execute() -} - -type SetImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - setImageSharePayload *SetImageSharePayload -} - -// Settings for an Image Share. - -func (r SetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { - r.setImageSharePayload = &setImageSharePayload - return r -} - -func (r SetImageShareRequest) Execute() (*ImageShare, error) { - var ( - localVarHTTPMethod = http.MethodPut - 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.SetImageShare") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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) - - 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 r.setImageSharePayload == nil { - return localVarReturnValue, fmt.Errorf("setImageSharePayload 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.setImageSharePayload - 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 -} - -/* -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 imageId The identifier (ID) of a STACKIT Image. - @return ApiSetImageShareRequest -*/ -func (a *APIClient) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { - return SetImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } -} - -func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := SetImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() -} - -type StartServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r StartServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.StartServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/start" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 == 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiStartServerRequest -*/ -func (a *APIClient) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { - return StartServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, serverId string) error { - r := StartServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type StopServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r StopServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.StopServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 == 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiStopServerRequest -*/ -func (a *APIClient) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { - return StopServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, serverId string) error { - r := StopServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type UnrescueServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r UnrescueServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - 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.UnrescueServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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 == 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 -} - -/* -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 serverId The identifier (ID) of a STACKIT Server. - @return ApiUnrescueServerRequest -*/ -func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { - return UnrescueServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, serverId string) error { - r := UnrescueServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } - return r.Execute() -} - -type UpdateAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string - updateAttachedVolumePayload *UpdateAttachedVolumePayload -} - -// Request a volume attachment update. - -func (r UpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { - r.updateAttachedVolumePayload = &updateAttachedVolumePayload - return r -} - -func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { - var ( - localVarHTTPMethod = http.MethodPatch - 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.UpdateAttachedVolume") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{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, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath := localBasePath + "/v2alpha1/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.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.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId 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.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } - if r.updateAttachedVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("updateAttachedVolumePayload is required and must be specified") + if r.addRoutesToRoutingTablePayload == nil { + return localVarReturnValue, fmt.Errorf("addRoutesToRoutingTablePayload is required and must be specified") } // to determine the Content-Type header @@ -25183,7 +511,7 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAttachedVolumePayload + localVarPostBody = r.addRoutesToRoutingTablePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25238,7 +566,18 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { + 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 { @@ -25249,7 +588,7 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -25287,90 +626,95 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -UpdateAttachedVolume: Update Volume Attachment Parameters. +AddRoutesToRoutingTable: Create new routes in a routing table. -Update the properties of an existing Volume Attachment. +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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiUpdateAttachedVolumeRequest + @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) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { - return UpdateAttachedVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +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) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := UpdateAttachedVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +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 UpdateBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - backupId string - updateBackupPayload *UpdateBackupPayload +type AddRoutingTableToAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload } -// Request an update of a backup. +// Request an addition of a routing table to an area. -func (r UpdateBackupRequest) UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest { - r.updateBackupPayload = &updateBackupPayload +func (r AddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { + r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload return r } -func (r UpdateBackupRequest) Execute() (*Backup, error) { +func (r AddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Backup + 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.UpdateBackup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddRoutingTableToArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}" - 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 := localBasePath + "/v2alpha1/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.backupId) < 36 { - return localVarReturnValue, fmt.Errorf("backupId 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.backupId) > 36 { - return localVarReturnValue, fmt.Errorf("backupId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.updateBackupPayload == nil { - return localVarReturnValue, fmt.Errorf("updateBackupPayload is required and must be specified") + if r.addRoutingTableToAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("addRoutingTableToAreaPayload is required and must be specified") } // to determine the Content-Type header @@ -25391,7 +735,7 @@ func (r UpdateBackupRequest) Execute() (*Backup, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateBackupPayload + localVarPostBody = r.addRoutingTableToAreaPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25468,6 +812,17 @@ func (r UpdateBackupRequest) 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")) @@ -25495,69 +850,72 @@ func (r UpdateBackupRequest) Execute() (*Backup, error) { } /* -UpdateBackup: Update information of a backup. +AddRoutingTableToArea: Create new routing table in a network area. -Update name or labels of the backup. +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 backupId The identifier (ID) of a STACKIT Backup. - @return ApiUpdateBackupRequest + @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) UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest { - return UpdateBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, +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) UpdateBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { - r := UpdateBackupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - backupId: backupId, +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 UpdateImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - updateImagePayload *UpdateImagePayload +type CreateNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createNetworkPayload *CreateNetworkPayload } -// Request an update of an Image. +// Request a network creation. -func (r UpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { - r.updateImagePayload = &updateImagePayload +func (r CreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload return r } -func (r UpdateImageRequest) Execute() (*Image, error) { +func (r CreateNetworkRequest) Execute() (*Network, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + 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.UpdateImage") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -25568,14 +926,8 @@ func (r UpdateImageRequest) Execute() (*Image, error) { 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 r.updateImagePayload == nil { - return localVarReturnValue, fmt.Errorf("updateImagePayload 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 @@ -25596,7 +948,7 @@ func (r UpdateImageRequest) Execute() (*Image, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateImagePayload + localVarPostBody = r.createNetworkPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25673,6 +1025,17 @@ func (r UpdateImageRequest) 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")) @@ -25700,76 +1063,77 @@ func (r UpdateImageRequest) Execute() (*Image, error) { } /* -UpdateImage: Update Image Parameters. +CreateNetwork: Create new network. -Update the properties of an existing Image inside a project. +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 projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageRequest + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest */ -func (a *APIClient) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { - return UpdateImageRequest{ +func (a *APIClient) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return CreateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, } } -func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := UpdateImageRequest{ +func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) { + r := CreateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, } return r.Execute() } -type UpdateImageScopeLocalRequest struct { +type DeleteNetworkRequest struct { ctx context.Context apiService *DefaultApiService projectId string - imageId string + region string + networkId string } -func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { +func (r DeleteNetworkRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Image + localVarHTTPMethod = http.MethodDelete + 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.UpdateImageScopeLocal") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetwork") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/publish" + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return fmt.Errorf("networkId 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.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") } // to determine the Content-Type header @@ -25791,7 +1155,7 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { } 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) @@ -25805,14 +1169,14 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, 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 { @@ -25826,142 +1190,163 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, 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 == 500 { + 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 newErr } - 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(), + 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 localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -UpdateImageScopeLocal: Update Image Scope to Local. +DeleteNetwork: Delete network. -Update the scope property of an existing Image inside a project to local. +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 projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageScopeLocalRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest */ -func (a *APIClient) UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest { - return UpdateImageScopeLocalRequest{ +func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return DeleteNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, + networkId: networkId, } } -func (a *APIClient) UpdateImageScopeLocalExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := UpdateImageScopeLocalRequest{ +func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error { + r := DeleteNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, + networkId: networkId, } return r.Execute() } -type UpdateImageScopePublicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type DeleteRouteFromRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + routeId string } -func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { +func (r DeleteRouteFromRoutingTableRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Image + localVarHTTPMethod = http.MethodDelete + 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.UpdateImageScopePublic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRouteFromRoutingTable") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/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 + "/v2alpha1/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 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 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 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") + } + if strlen(r.routeId) < 36 { + return fmt.Errorf("routeId 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.routeId) > 36 { + return fmt.Errorf("routeId must have less than 36 elements") } // to determine the Content-Type header @@ -25983,7 +1368,7 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { } 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) @@ -25997,14 +1382,14 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, 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 { @@ -26018,157 +1403,154 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, 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 == 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(), + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -UpdateImageScopePublic: Update Image Scope to Public. +DeleteRouteFromRoutingTable: Delete a route in a routing table. -Update the scope property of an existing Image inside a project to public. +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 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. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest */ -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) 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) UpdateImageScopePublicExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := UpdateImageScopePublicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +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 UpdateImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - updateImageSharePayload *UpdateImageSharePayload -} - -// Update an Image Share. - -func (r UpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { - r.updateImageSharePayload = &updateImageSharePayload - return r +type DeleteRoutingTableFromAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string } -func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { +func (r DeleteRoutingTableFromAreaRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ImageShare + localVarHTTPMethod = http.MethodDelete + 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.UpdateImageShare") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRoutingTableFromArea") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/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 + "/v2alpha1/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 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 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.imageId) < 36 { - return localVarReturnValue, 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 localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.routingTableId) < 36 { + return fmt.Errorf("routingTableId must have at least 36 elements") } - if r.updateImageSharePayload == nil { - return localVarReturnValue, fmt.Errorf("updateImageSharePayload is required and must be specified") + if strlen(r.routingTableId) > 36 { + return fmt.Errorf("routingTableId 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) @@ -26184,11 +1566,9 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, 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 + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -26202,14 +1582,14 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, 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 { @@ -26223,146 +1603,144 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, 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 == 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 } /* -UpdateImageShare: Update image share. +DeleteRoutingTableFromArea: Delete a routing table. -Update share of an Image. Projects will be appended to existing list. +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 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 routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest */ -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) 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) UpdateImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := UpdateImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +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 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 +type GetNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string } -func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { +func (r GetNetworkRequest) Execute() (*Network, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + 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.UpdateKeyPair") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v2alpha1/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.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 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 r.updateKeyPairPayload == nil { - return localVarReturnValue, fmt.Errorf("updateKeyPairPayload is required and must be specified") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId 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) @@ -26378,8 +1756,6 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { 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 @@ -26483,96 +1859,101 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { } /* -UpdateKeyPair: Update information of an SSH keypair. +GetNetwork: Get network details. -Update labels of the SSH keypair. +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 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. + @return ApiGetNetworkRequest */ -func (a *APIClient) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { - return UpdateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return GetNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } } -func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { - r := UpdateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, error) { + r := GetNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } return r.Execute() } -type UpdateNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string - updateNicPayload *UpdateNicPayload -} - -// Request an update of a network interface. - -func (r UpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { - r.updateNicPayload = &updateNicPayload - return r +type GetRouteOfRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + routeId string } -func (r UpdateNicRequest) Execute() (*NIC, error) { +func (r GetRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet 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.GetRouteOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/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 + "/v2alpha1/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.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 at least 36 elements") + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 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 less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -26588,8 +1969,6 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateNicPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -26666,17 +2045,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")) @@ -26704,94 +2072,99 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { } /* -UpdateNic: Update a network interface. +GetRouteOfRoutingTable: Get details about a route of a routing table. -Update the properties of an existing network interface inside a network. +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 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 ApiGetRouteOfRoutingTableRequest */ -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) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return GetRouteOfRoutingTableRequest{ + 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) 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, + 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 -} - -// Request an update of a public IP. - -func (r UpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { - r.updatePublicIPPayload = &updatePublicIPPayload - return r +type GetRoutingTableOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string } -func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { +func (r GetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet 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.GetRoutingTableOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/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 + "/v2alpha1/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.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 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 less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -26807,8 +2180,6 @@ func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updatePublicIPPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -26912,69 +2283,75 @@ func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { } /* -UpdatePublicIP: Update a public IP. +GetRoutingTableOfArea: Get details about a routing table. -Update the properties of an existing public IP inside a 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. - @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 ApiGetRoutingTableOfAreaRequest */ -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) 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) UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := UpdatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +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 UpdateSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - updateSecurityGroupPayload *UpdateSecurityGroupPayload +type ListNetworksRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + labelSelector *string } -// Request an update of a security group. +// Filter resources by labels. -func (r UpdateSecurityGroupRequest) UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest { - r.updateSecurityGroupPayload = &updateSecurityGroupPayload +func (r ListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector return r } -func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + 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.UpdateSecurityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -26985,18 +2362,12 @@ func (r UpdateSecurityGroupRequest) 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.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } - if r.updateSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("updateSecurityGroupPayload is required and must be specified") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -27012,8 +2383,6 @@ func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateSecurityGroupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -27117,91 +2486,101 @@ func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -UpdateSecurityGroup: Update information of a security group. +ListNetworks: List all networks inside a project. -Update labels of the security group. +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 projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiUpdateSecurityGroupRequest + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest */ -func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { - return UpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +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) UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := UpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +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 UpdateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - updateServerPayload *UpdateServerPayload +type ListRoutesOfRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + labelSelector *string } -// Request an update of a server. +// Filter resources by labels. -func (r UpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { - r.updateServerPayload = &updateServerPayload +func (r ListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { + r.labelSelector = &labelSelector return r } -func (r UpdateServerRequest) Execute() (*Server, error) { +func (r ListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + 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.UpdateServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRoutesOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" - 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 := localBasePath + "/v2alpha1/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.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 less than 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") } - if r.updateServerPayload == nil { - return localVarReturnValue, fmt.Errorf("updateServerPayload is required and must be specified") + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -27217,8 +2596,6 @@ func (r UpdateServerRequest) Execute() (*Server, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateServerPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -27322,91 +2699,99 @@ func (r UpdateServerRequest) Execute() (*Server, error) { } /* -UpdateServer: Update information of a server. +ListRoutesOfRoutingTable: List all routes in a routing table. -Update name or labels of the server. +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. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiUpdateServerRequest + @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) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { - return UpdateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +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) UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := UpdateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +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 UpdateSnapshotRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - snapshotId string - updateSnapshotPayload *UpdateSnapshotPayload +type ListRoutingTablesOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + labelSelector *string } -// Request an update of a snapshot. +// Filter resources by labels. -func (r UpdateSnapshotRequest) UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest { - r.updateSnapshotPayload = &updateSnapshotPayload +func (r ListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { + r.labelSelector = &labelSelector return r } -func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { +func (r ListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Snapshot + 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.UpdateSnapshot") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRoutingTablesOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - 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 := localBasePath + "/v2alpha1/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.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 at least 36 elements") } - if strlen(r.snapshotId) < 36 { - return localVarReturnValue, fmt.Errorf("snapshotId 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.snapshotId) > 36 { - return localVarReturnValue, fmt.Errorf("snapshotId must have less than 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if r.updateSnapshotPayload == nil { - return localVarReturnValue, fmt.Errorf("updateSnapshotPayload is required and must be specified") + 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{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -27422,8 +2807,6 @@ func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateSnapshotPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -27527,51 +2910,54 @@ func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { } /* -UpdateSnapshot: Update information of the snapshot. +ListRoutingTablesOfArea: List all routing tables in a network area. -Update information like name or labels of the snapshot. +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. - @param snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiUpdateSnapshotRequest + @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) UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest { - return UpdateSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, +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) UpdateSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { - r := UpdateSnapshotRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - snapshotId: snapshotId, +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() } -type UpdateVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string - updateVirtualIPPayload *UpdateVirtualIPPayload +type PartialUpdateNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload } -// Request an update of a virtual IP. +// Request an update of a network. -func (r UpdateVirtualIPRequest) UpdateVirtualIPPayload(updateVirtualIPPayload UpdateVirtualIPPayload) ApiUpdateVirtualIPRequest { - r.updateVirtualIPPayload = &updateVirtualIPPayload +func (r PartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload return r } -func (r UpdateVirtualIPRequest) Execute() error { +func (r PartialUpdateNetworkRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -27582,15 +2968,15 @@ func (r UpdateVirtualIPRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateVirtualIP") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateNetwork") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + localVarPath := localBasePath + "/v2alpha1/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) - localVarPath = strings.Replace(localVarPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -27607,14 +2993,8 @@ func (r UpdateVirtualIPRequest) Execute() error { if strlen(r.networkId) > 36 { return fmt.Errorf("networkId must have less than 36 elements") } - if strlen(r.virtualIpId) < 36 { - return fmt.Errorf("virtualIpId must have at least 36 elements") - } - if strlen(r.virtualIpId) > 36 { - return fmt.Errorf("virtualIpId must have less than 36 elements") - } - if r.updateVirtualIPPayload == nil { - return fmt.Errorf("updateVirtualIPPayload is required and must be specified") + if r.partialUpdateNetworkPayload == nil { + return fmt.Errorf("partialUpdateNetworkPayload is required and must be specified") } // to determine the Content-Type header @@ -27635,7 +3015,7 @@ func (r UpdateVirtualIPRequest) Execute() error { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateVirtualIPPayload + localVarPostBody = r.partialUpdateNetworkPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -27729,90 +3109,108 @@ func (r UpdateVirtualIPRequest) Execute() error { } /* -UpdateVirtualIP: Update a virtual IP. +PartialUpdateNetwork: Update network settings. -Update the properties of an existing virtual IP inside a project. +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. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiUpdateVirtualIPRequest + @return ApiPartialUpdateNetworkRequest */ -func (a *APIClient) UpdateVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiUpdateVirtualIPRequest { - return UpdateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +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) UpdateVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) error { - r := UpdateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +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() } -type UpdateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string - updateVolumePayload *UpdateVolumePayload +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 volume. +// Request an update of a route in a routing table. -func (r UpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { - r.updateVolumePayload = &updateVolumePayload +func (r UpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { + r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload return r } -func (r UpdateVolumeRequest) Execute() (*Volume, error) { +func (r UpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + 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.UpdateVolume") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRouteOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/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 + "/v2alpha1/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.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.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId 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.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.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") } - if r.updateVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("updateVolumePayload is required and must be specified") + if r.updateRouteOfRoutingTablePayload == nil { + return localVarReturnValue, fmt.Errorf("updateRouteOfRoutingTablePayload is required and must be specified") } // to determine the Content-Type header @@ -27833,7 +3231,7 @@ func (r UpdateVolumeRequest) Execute() (*Volume, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateVolumePayload + localVarPostBody = r.updateRouteOfRoutingTablePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -27937,71 +3335,82 @@ func (r UpdateVolumeRequest) Execute() (*Volume, error) { } /* -UpdateVolume: Update information of a volume. +UpdateRouteOfRoutingTable: Update a route of a routing table. -Update name, description or labels of the volume. +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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiUpdateVolumeRequest + @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) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { - return UpdateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, +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) UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := UpdateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, +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 V1alpha1UpdateRouteOfAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string - v1alpha1UpdateRouteOfAreaPayload *V1alpha1UpdateRouteOfAreaPayload +type UpdateRoutingTableOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload } -// Request an update of a network route. +// Request an update of a routing table. -func (r V1alpha1UpdateRouteOfAreaRequest) V1alpha1UpdateRouteOfAreaPayload(v1alpha1UpdateRouteOfAreaPayload V1alpha1UpdateRouteOfAreaPayload) ApiV1alpha1UpdateRouteOfAreaRequest { - r.v1alpha1UpdateRouteOfAreaPayload = &v1alpha1UpdateRouteOfAreaPayload +func (r UpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { + r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload return r } -func (r V1alpha1UpdateRouteOfAreaRequest) Execute() (*Route, error) { +func (r UpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Route + 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.V1alpha1UpdateRouteOfArea") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRoutingTableOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath := localBasePath + "/v2alpha1/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, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -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{} @@ -28018,14 +3427,14 @@ func (r V1alpha1UpdateRouteOfAreaRequest) Execute() (*Route, error) { 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.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId 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.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } - if r.v1alpha1UpdateRouteOfAreaPayload == nil { - return localVarReturnValue, fmt.Errorf("v1alpha1UpdateRouteOfAreaPayload is required and must be specified") + if r.updateRoutingTableOfAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("updateRoutingTableOfAreaPayload is required and must be specified") } // to determine the Content-Type header @@ -28046,7 +3455,7 @@ func (r V1alpha1UpdateRouteOfAreaRequest) Execute() (*Route, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.v1alpha1UpdateRouteOfAreaPayload + localVarPostBody = r.updateRoutingTableOfAreaPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -28150,33 +3559,36 @@ func (r V1alpha1UpdateRouteOfAreaRequest) Execute() (*Route, error) { } /* -V1alpha1UpdateRouteOfArea: Update a network route. +UpdateRoutingTableOfArea: Update a routing table. -Update a network route defined in a network area. +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 routeId The identifier (ID) of a STACKIT Route. - @return ApiV1alpha1UpdateRouteOfAreaRequest + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest */ -func (a *APIClient) V1alpha1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, routeId string) ApiV1alpha1UpdateRouteOfAreaRequest { - return V1alpha1UpdateRouteOfAreaRequest{ +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, - routeId: routeId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) V1alpha1UpdateRouteOfAreaExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) { - r := V1alpha1UpdateRouteOfAreaRequest{ +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, - routeId: routeId, + region: region, + routingTableId: routingTableId, } return r.Execute() } diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index b2c1671ac..a8099fe38 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -23,6007 +23,20 @@ import ( func Test_iaasalpha_DefaultApiService(t *testing.T) { - t.Run("Test DefaultApiService AddMemberToVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/add-member" - 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) - virtualIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} - 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 iaasalpha_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 - networkId := networkIdValue - virtualIpId := virtualIpIdValue - addMemberToVirtualIPPayload := AddMemberToVirtualIPPayload{} - - resp, reqErr := apiClient.AddMemberToVirtualIP(context.Background(), projectId, networkId, virtualIpId).AddMemberToVirtualIPPayload(addMemberToVirtualIPPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService AddNetworkToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - networkId := networkIdValue - - reqErr := apiClient.AddNetworkToServer(context.Background(), projectId, serverId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService AddNicToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - nicId := nicIdValue - - reqErr := apiClient.AddNicToServer(context.Background(), projectId, serverId, nicId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService AddPublicIpToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - publicIpId := publicIpIdValue - - reqErr := apiClient.AddPublicIpToServer(context.Background(), projectId, serverId, publicIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService AddSecurityGroupToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - securityGroupId := securityGroupIdValue - - reqErr := apiClient.AddSecurityGroupToServer(context.Background(), projectId, serverId, securityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService AddServiceAccountToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" - 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) - serviceAccountMailValue := randString(255) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ServiceAccountMailListResponse{} - 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 iaasalpha_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 - serverId := serverIdValue - serviceAccountMail := serviceAccountMailValue - - resp, reqErr := apiClient.AddServiceAccountToServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService AddVolumeToServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - 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) - 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) { - data := VolumeAttachment{} - 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 iaasalpha_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 - serverId := serverIdValue - volumeId := volumeIdValue - - resp, reqErr := apiClient.AddVolumeToServer(context.Background(), projectId, serverId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/affinity-groups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) - 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 iaasalpha_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 - createAffinityGroupPayload := CreateAffinityGroupPayload{} - - resp, reqErr := apiClient.CreateAffinityGroup(context.Background(), projectId).CreateAffinityGroupPayload(createAffinityGroupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateBackup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Backup{} - 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 iaasalpha_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 - createBackupPayload := CreateBackupPayload{} - - resp, reqErr := apiClient.CreateBackup(context.Background(), projectId).CreateBackupPayload(createBackupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateImage", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageCreateResponse{} - 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 iaasalpha_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 - createImagePayload := CreateImagePayload{} - - resp, reqErr := apiClient.CreateImage(context.Background(), projectId).CreateImagePayload(createImagePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/keypairs" - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Keypair{} - 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 iaasalpha_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) - } - - createKeyPairPayload := CreateKeyPairPayload{} - - resp, reqErr := apiClient.CreateKeyPair(context.Background()).CreateKeyPairPayload(createKeyPairPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateNetwork", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Network{} - 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 iaasalpha_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 - createNetworkPayload := CreateNetworkPayload{} - - resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId).CreateNetworkPayload(createNetworkPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkArea{} - 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 iaasalpha_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 - createNetworkAreaPayload := CreateNetworkAreaPayload{} - - resp, reqErr := apiClient.CreateNetworkArea(context.Background(), organizationId).CreateNetworkAreaPayload(createNetworkAreaPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/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) - - 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 iaasalpha_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 - createNetworkAreaRangePayload := CreateNetworkAreaRangePayload{} - - resp, reqErr := apiClient.CreateNetworkAreaRange(context.Background(), organizationId, areaId).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 CreateNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - createNetworkAreaRoutePayload := CreateNetworkAreaRoutePayload{} - - resp, reqErr := apiClient.CreateNetworkAreaRoute(context.Background(), organizationId, areaId).CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateNic", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} - 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 iaasalpha_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 - networkId := networkIdValue - createNicPayload := CreateNicPayload{} - - resp, reqErr := apiClient.CreateNic(context.Background(), projectId, networkId).CreateNicPayload(createNicPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreatePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/public-ips" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} - 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 iaasalpha_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 - createPublicIPPayload := CreatePublicIPPayload{} - - resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createPublicIPPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} - 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 iaasalpha_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 - createSecurityGroupPayload := CreateSecurityGroupPayload{} - - resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRule{} - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - createSecurityGroupRulePayload := CreateSecurityGroupRulePayload{} - - resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Server{} - 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 iaasalpha_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 - createServerPayload := CreateServerPayload{} - - resp, reqErr := apiClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/snapshots" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Snapshot{} - 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 iaasalpha_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 - createSnapshotPayload := CreateSnapshotPayload{} - - resp, reqErr := apiClient.CreateSnapshot(context.Background(), projectId).CreateSnapshotPayload(createSnapshotPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} - 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 iaasalpha_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 - networkId := networkIdValue - createVirtualIPPayload := CreateVirtualIPPayload{} - - resp, reqErr := apiClient.CreateVirtualIP(context.Background(), projectId, networkId).CreateVirtualIPPayload(createVirtualIPPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Volume{} - 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 iaasalpha_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 - createVolumePayload := CreateVolumePayload{} - - resp, reqErr := apiClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeallocateServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.DeallocateServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" - 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) - - 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 iaasalpha_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 - affinityGroupId := affinityGroupIdValue - - reqErr := apiClient.DeleteAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteBackup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups/{backupId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -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 iaasalpha_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 - backupId := backupIdValue - - reqErr := apiClient.DeleteBackup(context.Background(), projectId, backupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteImage", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}" - 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) - - 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 iaasalpha_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 - imageId := imageIdValue - - reqErr := apiClient.DeleteImage(context.Background(), projectId, imageId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteImageShare", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - imageId := imageIdValue - - reqErr := apiClient.DeleteImageShare(context.Background(), projectId, imageId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteImageShareConsumer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" - 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) - consumerProjectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -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 iaasalpha_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 - imageId := imageIdValue - consumerProjectId := consumerProjectIdValue - - reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) { - }) - 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 iaasalpha_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) - } - - keypairName := keypairNameValue - - reqErr := apiClient.DeleteKeyPair(context.Background(), keypairName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteNetwork", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}" - 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) - - 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 iaasalpha_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 - networkId := networkIdValue - - reqErr := apiClient.DeleteNetwork(context.Background(), projectId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - 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) { - }) - 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 iaasalpha_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 - - reqErr := apiClient.DeleteNetworkArea(context.Background(), organizationId, areaId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/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) - networkRangeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -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 iaasalpha_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 - networkRangeId := networkRangeIdValue - - reqErr := apiClient.DeleteNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - routeId := routeIdValue - - reqErr := apiClient.DeleteNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - networkId := networkIdValue - nicId := nicIdValue - - reqErr := apiClient.DeleteNic(context.Background(), projectId, networkId, nicId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - publicIpId := publicIpIdValue - - reqErr := apiClient.DeletePublicIP(context.Background(), projectId, publicIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" - 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) - - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - - reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, securityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - securityGroupRuleId := securityGroupRuleIdValue - - reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.DeleteServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - 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) - - 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 iaasalpha_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 - snapshotId := snapshotIdValue - - reqErr := apiClient.DeleteSnapshot(context.Background(), projectId, snapshotId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" - 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) - virtualIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -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 iaasalpha_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 - networkId := networkIdValue - virtualIpId := virtualIpIdValue - - reqErr := apiClient.DeleteVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" - 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) - - 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 iaasalpha_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 - volumeId := volumeIdValue - - reqErr := apiClient.DeleteVolume(context.Background(), projectId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService GetAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" - 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) - - 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) - 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 iaasalpha_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 - affinityGroupId := affinityGroupIdValue - - resp, reqErr := apiClient.GetAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetAttachedVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - 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) - 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) { - data := VolumeAttachment{} - 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 iaasalpha_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 - serverId := serverIdValue - volumeId := volumeIdValue - - resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, serverId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups/{backupId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Backup{} - 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 iaasalpha_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 - backupId := backupIdValue - - resp, reqErr := apiClient.GetBackup(context.Background(), projectId, backupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetImage", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Image{} - 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 iaasalpha_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 - imageId := imageIdValue - - resp, reqErr := apiClient.GetImage(context.Background(), projectId, imageId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetImageShare", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageShare{} - 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 iaasalpha_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 - imageId := imageIdValue - - resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, imageId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetImageShareConsumer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" - 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) - consumerProjectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageShareConsumer{} - 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 iaasalpha_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 - imageId := imageIdValue - consumerProjectId := consumerProjectIdValue - - resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 := Keypair{} - 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 iaasalpha_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) - } - - keypairName := keypairNameValue - - resp, reqErr := apiClient.GetKeyPair(context.Background(), keypairName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetMachineType", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/machine-types/{machineType}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - machineTypeValue := randString(127) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := MachineType{} - 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 iaasalpha_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 - machineType := machineTypeValue - - resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, machineType).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetNetwork", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Network{} - 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 iaasalpha_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 - networkId := networkIdValue - - resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - 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 := NetworkArea{} - 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 iaasalpha_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.GetNetworkArea(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 GetNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/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) - networkRangeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkRange{} - 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 iaasalpha_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 - networkRangeId := networkRangeIdValue - - resp, reqErr := apiClient.GetNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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 - routeId := routeIdValue - - resp, reqErr := apiClient.GetNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetNic", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} - 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 iaasalpha_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 - networkId := networkIdValue - nicId := nicIdValue - - resp, reqErr := apiClient.GetNic(context.Background(), projectId, networkId, nicId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetOrganizationRequest", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/requests/{requestId}" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - requestIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Request{} - 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 iaasalpha_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 - requestId := requestIdValue - - resp, reqErr := apiClient.GetOrganizationRequest(context.Background(), organizationId, requestId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetProjectDetails", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Project{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.GetProjectDetails(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetProjectNIC", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/nics/{nicId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := NIC{} - 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 iaasalpha_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 - nicId := nicIdValue - - resp, reqErr := apiClient.GetProjectNIC(context.Background(), projectId, nicId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetProjectRequest", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/requests/{requestId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - requestIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Request{} - 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 iaasalpha_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 - requestId := requestIdValue - - resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, requestId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetPublicIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} - 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 iaasalpha_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 - publicIpId := publicIpIdValue - - resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, publicIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - - resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, securityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRule{} - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - securityGroupRuleId := securityGroupRuleIdValue - - resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Server{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.GetServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetServerConsole", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/console" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ServerConsoleUrl{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/log" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetServerLog200Response{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Snapshot{} - 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 iaasalpha_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 - snapshotId := snapshotIdValue - - resp, reqErr := apiClient.GetSnapshot(context.Background(), projectId, snapshotId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" - 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) - virtualIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} - 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 iaasalpha_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 - networkId := networkIdValue - virtualIpId := virtualIpIdValue - - resp, reqErr := apiClient.GetVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Volume{} - 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 iaasalpha_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 - volumeId := volumeIdValue - - resp, reqErr := apiClient.GetVolume(context.Background(), projectId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetVolumePerformanceClass", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumePerformanceClassValue := randString(127) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VolumePerformanceClass{} - 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 iaasalpha_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 - volumePerformanceClass := volumePerformanceClassValue - - resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, volumePerformanceClass).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAffinityGroups", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/affinity-groups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AffinityGroupListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListAffinityGroups(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAttachedVolumes", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VolumeAttachmentListResponse{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAvailabilityZones", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/availability-zones" - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AvailabilityZoneListResponse{} - 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 iaasalpha_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) - } - - resp, reqErr := apiClient.ListAvailabilityZones(context.Background()).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := BackupListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListBackups(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListImages", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListImages(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListKeyPairs", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/keypairs" - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := KeyPairListResponse{} - 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 iaasalpha_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) - } - - resp, reqErr := apiClient.ListKeyPairs(context.Background()).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListMachineTypes", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/machine-types" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := MachineTypeListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId).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 := "/v1alpha1/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 iaasalpha_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 := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/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) - - 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 iaasalpha_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.ListNetworkAreaRanges(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 ListNetworkAreaRoutes", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - 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 iaasalpha_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.ListNetworkAreaRoutes(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 ListNetworkAreas", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkAreaListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListNetworks(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListNics", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} - 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 iaasalpha_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 - networkId := networkIdValue - - resp, reqErr := apiClient.ListNics(context.Background(), projectId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListProjectNICs", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/nics" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListProjectNICs(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/public-ips" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicIpListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListPublicIpRanges", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/networks/public-ip-ranges" - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicNetworkListResponse{} - 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 iaasalpha_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) - } - - resp, reqErr := apiClient.ListPublicIpRanges(context.Background()).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListQuotas", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/quotas" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := QuotaListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListQuotas(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListSecurityGroupRules", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRuleListResponse{} - 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 iaasalpha_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 - securityGroupId := securityGroupIdValue - - resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, securityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListSecurityGroups", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListServerNics", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.ListServerNics(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListServerServiceAccounts", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ServiceAccountMailListResponse{} - 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 iaasalpha_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 - serverId := serverIdValue - - resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListServers", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ServerListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListServers(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListSnapshots", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/snapshots" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SnapshotListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListSnapshots(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListVirtualIPs", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - 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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIpListResponse{} - 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 iaasalpha_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 - networkId := networkIdValue - - resp, reqErr := apiClient.ListVirtualIPs(context.Background(), projectId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListVolumePerformanceClasses", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volume-performance-classes" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VolumePerformanceClassListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListVolumes", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VolumeListResponse{} - 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 iaasalpha_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 - - resp, reqErr := apiClient.ListVolumes(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService PartialUpdateNetwork", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}" - 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) - - 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 iaasalpha_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 - networkId := networkIdValue - partialUpdateNetworkPayload := PartialUpdateNetworkPayload{} - - reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService PartialUpdateNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - 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 := NetworkArea{} - 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 iaasalpha_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 - partialUpdateNetworkAreaPayload := PartialUpdateNetworkAreaPayload{} - - resp, reqErr := apiClient.PartialUpdateNetworkArea(context.Background(), organizationId, areaId).PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService RebootServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.RebootServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RemoveMemberFromVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" - 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) - virtualIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} - 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 iaasalpha_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 - networkId := networkIdValue - virtualIpId := virtualIpIdValue - removeMemberFromVirtualIPPayload := RemoveMemberFromVirtualIPPayload{} - - resp, reqErr := apiClient.RemoveMemberFromVirtualIP(context.Background(), projectId, networkId, virtualIpId).RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService RemoveNetworkFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - networkId := networkIdValue - - reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, serverId, networkId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RemoveNicFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - nicId := nicIdValue - - reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, serverId, nicId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RemovePublicIpFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - publicIpId := publicIpIdValue - - reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, serverId, publicIpId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RemoveSecurityGroupFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" - 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) - 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) { - }) - 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 iaasalpha_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 - serverId := serverIdValue - securityGroupId := securityGroupIdValue - - reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, serverId, securityGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RemoveServiceAccountFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" - 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) - serviceAccountMailValue := randString(255) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ServiceAccountMailListResponse{} - 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 iaasalpha_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 - serverId := serverIdValue - serviceAccountMail := serviceAccountMailValue - - resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService RemoveVolumeFromServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - 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) - 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 iaasalpha_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 - serverId := serverIdValue - volumeId := volumeIdValue - - reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RescueServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - rescueServerPayload := RescueServerPayload{} - - reqErr := apiClient.RescueServer(context.Background(), projectId, serverId).RescueServerPayload(rescueServerPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService ResizeServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - resizeServerPayload := ResizeServerPayload{} - - reqErr := apiClient.ResizeServer(context.Background(), projectId, serverId).ResizeServerPayload(resizeServerPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService ResizeVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" - 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) - - 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 iaasalpha_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 - volumeId := volumeIdValue - - reqErr := apiClient.ResizeVolume(context.Background(), projectId, volumeId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService RestoreBackup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups/{backupId}/restore" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -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 iaasalpha_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 - backupId := backupIdValue - - reqErr := apiClient.RestoreBackup(context.Background(), projectId, backupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService SetImageShare", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageShare{} - 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 iaasalpha_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 - imageId := imageIdValue - setImageSharePayload := SetImageSharePayload{} - - resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, imageId).SetImageSharePayload(setImageSharePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService StartServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/start" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.StartServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService StopServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.StopServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService UnrescueServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" - 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) - - 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 iaasalpha_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 - serverId := serverIdValue - - reqErr := apiClient.UnrescueServer(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService UpdateAttachedVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - 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) - volumeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + t.Run("Test DefaultApiService AddRoutesToRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := VolumeAttachment{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6056,12 +69,13 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - serverId := serverIdValue - volumeId := volumeIdValue - updateAttachedVolumePayload := UpdateAttachedVolumePayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + addRoutesToRoutingTablePayload := AddRoutesToRoutingTablePayload{} - resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() + resp, reqErr := apiClient.AddRoutesToRoutingTable(context.Background(), organizationId, areaId, region, routingTableId).AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6071,16 +85,18 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateBackup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/backups/{backupId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + t.Run("Test DefaultApiService AddRoutingTableToArea", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := Backup{} + data := RoutingTable{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6113,11 +129,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - backupId := backupIdValue - updateBackupPayload := UpdateBackupPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + addRoutingTableToAreaPayload := AddRoutingTableToAreaPayload{} - resp, reqErr := apiClient.UpdateBackup(context.Background(), projectId, backupId).UpdateBackupPayload(updateBackupPayload).Execute() + resp, reqErr := apiClient.AddRoutingTableToArea(context.Background(), organizationId, areaId, region).AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6127,16 +144,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImage", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}" + t.Run("Test DefaultApiService CreateNetwork", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/projects/{projectId}/regions/{region}/networks" 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) + 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 := Image{} + data := Network{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6170,10 +187,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := projectIdValue - imageId := imageIdValue - updateImagePayload := UpdateImagePayload{} + region := regionValue + createNetworkPayload := CreateNetworkPayload{} - resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, imageId).UpdateImagePayload(updateImagePayload).Execute() + resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId, region).CreateNetworkPayload(createNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6183,18 +200,17 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImageScopeLocal", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/images/{imageId}/publish" + t.Run("Test DefaultApiService DeleteNetwork", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" 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) + 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 := Image{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -6226,30 +242,31 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := projectIdValue - imageId := imageIdValue + region := regionValue + networkId := networkIdValue - resp, reqErr := apiClient.UpdateImageScopeLocal(context.Background(), projectId, imageId).Execute() + reqErr := apiClient.DeleteNetwork(context.Background(), projectId, region, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if IsNil(resp) { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService UpdateImageScopePublic", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 DeleteRouteFromRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := Image{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -6280,31 +297,32 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - imageId := imageIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue - resp, reqErr := apiClient.UpdateImageScopePublic(context.Background(), projectId, imageId).Execute() + reqErr := apiClient.DeleteRouteFromRoutingTable(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 UpdateImageShare", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 DeleteRoutingTableFromArea", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := ImageShare{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -6335,28 +353,30 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - imageId := imageIdValue - updateImageSharePayload := UpdateImageSharePayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue - resp, reqErr := apiClient.UpdateImageShare(context.Background(), projectId, imageId).UpdateImageSharePayload(updateImageSharePayload).Execute() + reqErr := apiClient.DeleteRoutingTableFromArea(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if IsNil(resp) { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := randString(127) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + t.Run("Test DefaultApiService GetNetwork", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Keypair{} + data := Network{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6389,10 +409,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := keypairNameValue - updateKeyPairPayload := UpdateKeyPairPayload{} + projectId := projectIdValue + region := regionValue + networkId := networkIdValue - resp, reqErr := apiClient.UpdateKeyPair(context.Background(), keypairName).UpdateKeyPairPayload(updateKeyPairPayload).Execute() + resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, region, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6402,18 +423,22 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateNic", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 GetRouteOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := NIC{} + data := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6446,12 +471,13 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - networkId := networkIdValue - nicId := nicIdValue - updateNicPayload := UpdateNicPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue - resp, reqErr := apiClient.UpdateNic(context.Background(), projectId, networkId, nicId).UpdateNicPayload(updateNicPayload).Execute() + resp, reqErr := apiClient.GetRouteOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId, routeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6461,16 +487,20 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdatePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 GetRoutingTableOfArea", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := PublicIp{} + data := RoutingTable{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6503,11 +533,12 @@ func Test_iaasalpha_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 - resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() + resp, reqErr := apiClient.GetRoutingTableOfArea(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6517,16 +548,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/projects/{projectId}/regions/{region}/networks" 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) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} + data := NetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6560,10 +591,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := projectIdValue - securityGroupId := securityGroupIdValue - updateSecurityGroupPayload := UpdateSecurityGroupPayload{} + region := regionValue - resp, reqErr := apiClient.UpdateSecurityGroup(context.Background(), projectId, securityGroupId).UpdateSecurityGroupPayload(updateSecurityGroupPayload).Execute() + resp, reqErr := apiClient.ListNetworks(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6573,16 +603,20 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateServer", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/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 ListRoutesOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := Server{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6615,11 +649,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - serverId := serverIdValue - updateServerPayload := UpdateServerPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue - resp, reqErr := apiClient.UpdateServer(context.Background(), projectId, serverId).UpdateServerPayload(updateServerPayload).Execute() + resp, reqErr := apiClient.ListRoutesOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6629,16 +664,18 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" - 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) + t.Run("Test DefaultApiService ListRoutingTablesOfArea", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := Snapshot{} + data := RoutingTableListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6671,11 +708,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - snapshotId := snapshotIdValue - updateSnapshotPayload := UpdateSnapshotPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue - resp, reqErr := apiClient.UpdateSnapshot(context.Background(), projectId, snapshotId).UpdateSnapshotPayload(updateSnapshotPayload).Execute() + resp, reqErr := apiClient.ListRoutingTablesOfArea(context.Background(), organizationId, areaId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6685,14 +722,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateVirtualIP", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + t.Run("Test DefaultApiService PartialUpdateNetwork", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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) - virtualIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -6727,27 +764,33 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue - virtualIpId := virtualIpIdValue - updateVirtualIPPayload := UpdateVirtualIPPayload{} + partialUpdateNetworkPayload := PartialUpdateNetworkPayload{} - reqErr := apiClient.UpdateVirtualIP(context.Background(), projectId, networkId, virtualIpId).UpdateVirtualIPPayload(updateVirtualIPPayload).Execute() + reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, region, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService UpdateVolume", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" - 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) + t.Run("Test DefaultApiService UpdateRouteOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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 := Volume{} + data := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6780,11 +823,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - volumeId := volumeIdValue - updateVolumePayload := UpdateVolumePayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue + updateRouteOfRoutingTablePayload := UpdateRouteOfRoutingTablePayload{} - resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() + resp, reqErr := apiClient.UpdateRouteOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId, routeId).UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6794,18 +840,20 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService V1alpha1UpdateRouteOfArea", func(t *testing.T) { - _apiUrlPath := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + t.Run("Test DefaultApiService UpdateRoutingTableOfArea", func(t *testing.T) { + _apiUrlPath := "/v2alpha1/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) - 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) + 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 := Route{} + data := RoutingTable{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6840,10 +888,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue - routeId := routeIdValue - v1alpha1UpdateRouteOfAreaPayload := V1alpha1UpdateRouteOfAreaPayload{} + region := regionValue + routingTableId := routingTableIdValue + updateRoutingTableOfAreaPayload := UpdateRoutingTableOfAreaPayload{} - resp, reqErr := apiClient.V1alpha1UpdateRouteOfArea(context.Background(), organizationId, areaId, routeId).V1alpha1UpdateRouteOfAreaPayload(v1alpha1UpdateRouteOfAreaPayload).Execute() + resp, reqErr := apiClient.UpdateRoutingTableOfArea(context.Background(), organizationId, areaId, region, routingTableId).UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/iaasalpha/client.go b/services/iaasalpha/client.go index 1258c6ded..35123387a 100644 --- a/services/iaasalpha/client.go +++ b/services/iaasalpha/client.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // 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 v1alpha1 +// APIClient manages communication with the IaaS-API API v2alpha1 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/iaasalpha/configuration.go b/services/iaasalpha/configuration.go index e0da79c4b..9eb464e2c 100644 --- a/services/iaasalpha/configuration.go +++ b/services/iaasalpha/configuration.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // 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/iaasalpha/model_add_member_to_virtual_ip_payload.go b/services/iaasalpha/model_add_member_to_virtual_ip_payload.go deleted file mode 100644 index a0cdebcd5..000000000 --- a/services/iaasalpha/model_add_member_to_virtual_ip_payload.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AddMemberToVirtualIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddMemberToVirtualIPPayload{} - -/* - types and functions for member -*/ - -// isNotNullableString -type AddMemberToVirtualIPPayloadGetMemberAttributeType = *string - -func getAddMemberToVirtualIPPayloadGetMemberAttributeTypeOk(arg AddMemberToVirtualIPPayloadGetMemberAttributeType) (ret AddMemberToVirtualIPPayloadGetMemberRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAddMemberToVirtualIPPayloadGetMemberAttributeType(arg *AddMemberToVirtualIPPayloadGetMemberAttributeType, val AddMemberToVirtualIPPayloadGetMemberRetType) { - *arg = &val -} - -type AddMemberToVirtualIPPayloadGetMemberArgType = string -type AddMemberToVirtualIPPayloadGetMemberRetType = string - -// AddMemberToVirtualIPPayload Object that represents a virtual IP member. -type AddMemberToVirtualIPPayload struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Member AddMemberToVirtualIPPayloadGetMemberAttributeType `json:"member" required:"true"` -} - -type _AddMemberToVirtualIPPayload AddMemberToVirtualIPPayload - -// NewAddMemberToVirtualIPPayload instantiates a new AddMemberToVirtualIPPayload 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 NewAddMemberToVirtualIPPayload(member AddMemberToVirtualIPPayloadGetMemberArgType) *AddMemberToVirtualIPPayload { - this := AddMemberToVirtualIPPayload{} - setAddMemberToVirtualIPPayloadGetMemberAttributeType(&this.Member, member) - return &this -} - -// NewAddMemberToVirtualIPPayloadWithDefaults instantiates a new AddMemberToVirtualIPPayload 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 NewAddMemberToVirtualIPPayloadWithDefaults() *AddMemberToVirtualIPPayload { - this := AddMemberToVirtualIPPayload{} - return &this -} - -// GetMember returns the Member field value -func (o *AddMemberToVirtualIPPayload) GetMember() (ret AddMemberToVirtualIPPayloadGetMemberRetType) { - ret, _ = o.GetMemberOk() - return ret -} - -// GetMemberOk returns a tuple with the Member field value -// and a boolean to check if the value has been set. -func (o *AddMemberToVirtualIPPayload) GetMemberOk() (ret AddMemberToVirtualIPPayloadGetMemberRetType, ok bool) { - return getAddMemberToVirtualIPPayloadGetMemberAttributeTypeOk(o.Member) -} - -// SetMember sets field value -func (o *AddMemberToVirtualIPPayload) SetMember(v AddMemberToVirtualIPPayloadGetMemberRetType) { - setAddMemberToVirtualIPPayloadGetMemberAttributeType(&o.Member, v) -} - -func (o AddMemberToVirtualIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAddMemberToVirtualIPPayloadGetMemberAttributeTypeOk(o.Member); ok { - toSerialize["Member"] = val - } - return toSerialize, nil -} - -type NullableAddMemberToVirtualIPPayload struct { - value *AddMemberToVirtualIPPayload - isSet bool -} - -func (v NullableAddMemberToVirtualIPPayload) Get() *AddMemberToVirtualIPPayload { - return v.value -} - -func (v *NullableAddMemberToVirtualIPPayload) Set(val *AddMemberToVirtualIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddMemberToVirtualIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddMemberToVirtualIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddMemberToVirtualIPPayload(val *AddMemberToVirtualIPPayload) *NullableAddMemberToVirtualIPPayload { - return &NullableAddMemberToVirtualIPPayload{value: val, isSet: true} -} - -func (v NullableAddMemberToVirtualIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddMemberToVirtualIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_add_routes_to_routing_table_payload.go b/services/iaasalpha/model_add_routes_to_routing_table_payload.go new file mode 100644 index 000000000..1c726a9ff --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_affinity_group_list_response_test.go b/services/iaasalpha/model_add_routes_to_routing_table_payload_test.go similarity index 89% rename from services/iaasalpha/model_affinity_group_list_response_test.go rename to services/iaasalpha/model_add_routes_to_routing_table_payload_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_affinity_group_list_response_test.go +++ b/services/iaasalpha/model_add_routes_to_routing_table_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_add_routing_table_to_area_payload.go b/services/iaasalpha/model_add_routing_table_to_area_payload.go new file mode 100644 index 000000000..ffc9ffe9c --- /dev/null +++ b/services/iaasalpha/model_add_routing_table_to_area_payload.go @@ -0,0 +1,467 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 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 for this area. 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"` + // Universally Unique Identifier (UUID). + Id AddRoutingTableToAreaPayloadGetIdAttributeType `json:"id,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. + 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 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) +} + +// 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 := 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/iaasalpha/model_add_member_to_virtual_ip_payload_test.go b/services/iaasalpha/model_add_routing_table_to_area_payload_test.go similarity index 89% rename from services/iaasalpha/model_add_member_to_virtual_ip_payload_test.go rename to services/iaasalpha/model_add_routing_table_to_area_payload_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_add_member_to_virtual_ip_payload_test.go +++ b/services/iaasalpha/model_add_routing_table_to_area_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_add_volume_to_server_payload.go b/services/iaasalpha/model_add_volume_to_server_payload.go deleted file mode 100644 index 88a2ba1e2..000000000 --- a/services/iaasalpha/model_add_volume_to_server_payload.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AddVolumeToServerPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddVolumeToServerPayload{} - -/* - types and functions for deleteOnTermination -*/ - -// isBoolean -type AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType = *bool -type AddVolumeToServerPayloadgetDeleteOnTerminationArgType = bool -type AddVolumeToServerPayloadgetDeleteOnTerminationRetType = bool - -func getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(arg AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType) (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(arg *AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType, val AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { - *arg = &val -} - -/* - types and functions for serverId -*/ - -// isNotNullableString -type AddVolumeToServerPayloadGetServerIdAttributeType = *string - -func getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(arg AddVolumeToServerPayloadGetServerIdAttributeType) (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAddVolumeToServerPayloadGetServerIdAttributeType(arg *AddVolumeToServerPayloadGetServerIdAttributeType, val AddVolumeToServerPayloadGetServerIdRetType) { - *arg = &val -} - -type AddVolumeToServerPayloadGetServerIdArgType = string -type AddVolumeToServerPayloadGetServerIdRetType = string - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type AddVolumeToServerPayloadGetVolumeIdAttributeType = *string - -func getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(arg AddVolumeToServerPayloadGetVolumeIdAttributeType) (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAddVolumeToServerPayloadGetVolumeIdAttributeType(arg *AddVolumeToServerPayloadGetVolumeIdAttributeType, val AddVolumeToServerPayloadGetVolumeIdRetType) { - *arg = &val -} - -type AddVolumeToServerPayloadGetVolumeIdArgType = string -type AddVolumeToServerPayloadGetVolumeIdRetType = string - -// AddVolumeToServerPayload Object that represents a Volume attachment to a server. -type AddVolumeToServerPayload struct { - // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` - // Universally Unique Identifier (UUID). - ServerId AddVolumeToServerPayloadGetServerIdAttributeType `json:"serverId,omitempty"` - // Universally Unique Identifier (UUID). - VolumeId AddVolumeToServerPayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` -} - -// NewAddVolumeToServerPayload instantiates a new AddVolumeToServerPayload 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 NewAddVolumeToServerPayload() *AddVolumeToServerPayload { - this := AddVolumeToServerPayload{} - return &this -} - -// NewAddVolumeToServerPayloadWithDefaults instantiates a new AddVolumeToServerPayload 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 NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { - this := AddVolumeToServerPayload{} - return &this -} - -// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetDeleteOnTermination() (res AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { - 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 *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { - return getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) -} - -// HasDeleteOnTermination returns a boolean if a field has been set. -func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { - _, ok := o.GetDeleteOnTerminationOk() - return ok -} - -// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { - setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) -} - -// GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetServerId() (res AddVolumeToServerPayloadGetServerIdRetType) { - res, _ = o.GetServerIdOk() - return -} - -// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AddVolumeToServerPayload) GetServerIdOk() (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { - return getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(o.ServerId) -} - -// HasServerId returns a boolean if a field has been set. -func (o *AddVolumeToServerPayload) HasServerId() bool { - _, ok := o.GetServerIdOk() - return ok -} - -// SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *AddVolumeToServerPayload) SetServerId(v AddVolumeToServerPayloadGetServerIdRetType) { - setAddVolumeToServerPayloadGetServerIdAttributeType(&o.ServerId, v) -} - -// GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetVolumeId() (res AddVolumeToServerPayloadGetVolumeIdRetType) { - res, _ = o.GetVolumeIdOk() - return -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AddVolumeToServerPayload) GetVolumeIdOk() (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { - return getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// HasVolumeId returns a boolean if a field has been set. -func (o *AddVolumeToServerPayload) HasVolumeId() bool { - _, ok := o.GetVolumeIdOk() - return ok -} - -// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *AddVolumeToServerPayload) SetVolumeId(v AddVolumeToServerPayloadGetVolumeIdRetType) { - setAddVolumeToServerPayloadGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { - toSerialize["DeleteOnTermination"] = val - } - if val, ok := getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(o.ServerId); ok { - toSerialize["ServerId"] = val - } - if val, ok := getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableAddVolumeToServerPayload struct { - value *AddVolumeToServerPayload - isSet bool -} - -func (v NullableAddVolumeToServerPayload) Get() *AddVolumeToServerPayload { - return v.value -} - -func (v *NullableAddVolumeToServerPayload) Set(val *AddVolumeToServerPayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddVolumeToServerPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddVolumeToServerPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddVolumeToServerPayload(val *AddVolumeToServerPayload) *NullableAddVolumeToServerPayload { - return &NullableAddVolumeToServerPayload{value: val, isSet: true} -} - -func (v NullableAddVolumeToServerPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddVolumeToServerPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_affinity_group.go b/services/iaasalpha/model_affinity_group.go deleted file mode 100644 index 4c866c0bf..000000000 --- a/services/iaasalpha/model_affinity_group.go +++ /dev/null @@ -1,269 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AffinityGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AffinityGroup{} - -/* - types and functions for id -*/ - -// isNotNullableString -type AffinityGroupGetIdAttributeType = *string - -func getAffinityGroupGetIdAttributeTypeOk(arg AffinityGroupGetIdAttributeType) (ret AffinityGroupGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAffinityGroupGetIdAttributeType(arg *AffinityGroupGetIdAttributeType, val AffinityGroupGetIdRetType) { - *arg = &val -} - -type AffinityGroupGetIdArgType = string -type AffinityGroupGetIdRetType = string - -/* - types and functions for members -*/ - -// isArray -type AffinityGroupGetMembersAttributeType = *[]string -type AffinityGroupGetMembersArgType = []string -type AffinityGroupGetMembersRetType = []string - -func getAffinityGroupGetMembersAttributeTypeOk(arg AffinityGroupGetMembersAttributeType) (ret AffinityGroupGetMembersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAffinityGroupGetMembersAttributeType(arg *AffinityGroupGetMembersAttributeType, val AffinityGroupGetMembersRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type AffinityGroupGetNameAttributeType = *string - -func getAffinityGroupGetNameAttributeTypeOk(arg AffinityGroupGetNameAttributeType) (ret AffinityGroupGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAffinityGroupGetNameAttributeType(arg *AffinityGroupGetNameAttributeType, val AffinityGroupGetNameRetType) { - *arg = &val -} - -type AffinityGroupGetNameArgType = string -type AffinityGroupGetNameRetType = string - -/* - types and functions for policy -*/ - -// isNotNullableString -type AffinityGroupGetPolicyAttributeType = *string - -func getAffinityGroupGetPolicyAttributeTypeOk(arg AffinityGroupGetPolicyAttributeType) (ret AffinityGroupGetPolicyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAffinityGroupGetPolicyAttributeType(arg *AffinityGroupGetPolicyAttributeType, val AffinityGroupGetPolicyRetType) { - *arg = &val -} - -type AffinityGroupGetPolicyArgType = string -type AffinityGroupGetPolicyRetType = string - -// AffinityGroup Definition of an affinity group. -type AffinityGroup struct { - // Universally Unique Identifier (UUID). - Id AffinityGroupGetIdAttributeType `json:"id,omitempty"` - // The servers that are part of the affinity group. - Members AffinityGroupGetMembersAttributeType `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name AffinityGroupGetNameAttributeType `json:"name" required:"true"` - // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. - // REQUIRED - Policy AffinityGroupGetPolicyAttributeType `json:"policy" required:"true"` -} - -type _AffinityGroup AffinityGroup - -// NewAffinityGroup instantiates a new AffinityGroup 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 NewAffinityGroup(name AffinityGroupGetNameArgType, policy AffinityGroupGetPolicyArgType) *AffinityGroup { - this := AffinityGroup{} - setAffinityGroupGetNameAttributeType(&this.Name, name) - setAffinityGroupGetPolicyAttributeType(&this.Policy, policy) - return &this -} - -// NewAffinityGroupWithDefaults instantiates a new AffinityGroup 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 NewAffinityGroupWithDefaults() *AffinityGroup { - this := AffinityGroup{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *AffinityGroup) GetId() (res AffinityGroupGetIdRetType) { - 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 *AffinityGroup) GetIdOk() (ret AffinityGroupGetIdRetType, ok bool) { - return getAffinityGroupGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *AffinityGroup) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *AffinityGroup) SetId(v AffinityGroupGetIdRetType) { - setAffinityGroupGetIdAttributeType(&o.Id, v) -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *AffinityGroup) GetMembers() (res AffinityGroupGetMembersRetType) { - res, _ = o.GetMembersOk() - return -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AffinityGroup) GetMembersOk() (ret AffinityGroupGetMembersRetType, ok bool) { - return getAffinityGroupGetMembersAttributeTypeOk(o.Members) -} - -// HasMembers returns a boolean if a field has been set. -func (o *AffinityGroup) HasMembers() bool { - _, ok := o.GetMembersOk() - return ok -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *AffinityGroup) SetMembers(v AffinityGroupGetMembersRetType) { - setAffinityGroupGetMembersAttributeType(&o.Members, v) -} - -// GetName returns the Name field value -func (o *AffinityGroup) GetName() (ret AffinityGroupGetNameRetType) { - 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 *AffinityGroup) GetNameOk() (ret AffinityGroupGetNameRetType, ok bool) { - return getAffinityGroupGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *AffinityGroup) SetName(v AffinityGroupGetNameRetType) { - setAffinityGroupGetNameAttributeType(&o.Name, v) -} - -// GetPolicy returns the Policy field value -func (o *AffinityGroup) GetPolicy() (ret AffinityGroupGetPolicyRetType) { - ret, _ = o.GetPolicyOk() - return ret -} - -// GetPolicyOk returns a tuple with the Policy field value -// and a boolean to check if the value has been set. -func (o *AffinityGroup) GetPolicyOk() (ret AffinityGroupGetPolicyRetType, ok bool) { - return getAffinityGroupGetPolicyAttributeTypeOk(o.Policy) -} - -// SetPolicy sets field value -func (o *AffinityGroup) SetPolicy(v AffinityGroupGetPolicyRetType) { - setAffinityGroupGetPolicyAttributeType(&o.Policy, v) -} - -func (o AffinityGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAffinityGroupGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getAffinityGroupGetMembersAttributeTypeOk(o.Members); ok { - toSerialize["Members"] = val - } - if val, ok := getAffinityGroupGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getAffinityGroupGetPolicyAttributeTypeOk(o.Policy); ok { - toSerialize["Policy"] = val - } - return toSerialize, nil -} - -type NullableAffinityGroup struct { - value *AffinityGroup - isSet bool -} - -func (v NullableAffinityGroup) Get() *AffinityGroup { - return v.value -} - -func (v *NullableAffinityGroup) Set(val *AffinityGroup) { - v.value = val - v.isSet = true -} - -func (v NullableAffinityGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableAffinityGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { - return &NullableAffinityGroup{value: val, isSet: true} -} - -func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_affinity_group_list_response.go b/services/iaasalpha/model_affinity_group_list_response.go deleted file mode 100644 index 1d17ccfbf..000000000 --- a/services/iaasalpha/model_affinity_group_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AffinityGroupListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AffinityGroupListResponse{} - -/* - types and functions for items -*/ - -// isArray -type AffinityGroupListResponseGetItemsAttributeType = *[]AffinityGroup -type AffinityGroupListResponseGetItemsArgType = []AffinityGroup -type AffinityGroupListResponseGetItemsRetType = []AffinityGroup - -func getAffinityGroupListResponseGetItemsAttributeTypeOk(arg AffinityGroupListResponseGetItemsAttributeType) (ret AffinityGroupListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAffinityGroupListResponseGetItemsAttributeType(arg *AffinityGroupListResponseGetItemsAttributeType, val AffinityGroupListResponseGetItemsRetType) { - *arg = &val -} - -// AffinityGroupListResponse Response object for affinity group list request. -type AffinityGroupListResponse struct { - // A list of affinity groups. - // REQUIRED - Items AffinityGroupListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _AffinityGroupListResponse AffinityGroupListResponse - -// NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse 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 NewAffinityGroupListResponse(items AffinityGroupListResponseGetItemsArgType) *AffinityGroupListResponse { - this := AffinityGroupListResponse{} - setAffinityGroupListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse 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 NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { - this := AffinityGroupListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *AffinityGroupListResponse) GetItems() (ret AffinityGroupListResponseGetItemsRetType) { - 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 *AffinityGroupListResponse) GetItemsOk() (ret AffinityGroupListResponseGetItemsRetType, ok bool) { - return getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *AffinityGroupListResponse) SetItems(v AffinityGroupListResponseGetItemsRetType) { - setAffinityGroupListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableAffinityGroupListResponse struct { - value *AffinityGroupListResponse - isSet bool -} - -func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { - return v.value -} - -func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableAffinityGroupListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableAffinityGroupListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { - return &NullableAffinityGroupListResponse{value: val, isSet: true} -} - -func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_allowed_addresses_inner.go b/services/iaasalpha/model_allowed_addresses_inner.go deleted file mode 100644 index 40126c2bf..000000000 --- a/services/iaasalpha/model_allowed_addresses_inner.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "fmt" -) - -// AllowedAddressesInner - struct for AllowedAddressesInner -type AllowedAddressesInner struct { - String *string -} - -// stringAsAllowedAddressesInner is a convenience function that returns string wrapped in AllowedAddressesInner -func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { - return AllowedAddressesInner{ - String: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - match++ - } - } else { - dst.String = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.String = nil - - return fmt.Errorf("data matches more than one schema in oneOf(AllowedAddressesInner)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(AllowedAddressesInner)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { - if src.String != nil { - return json.Marshal(&src.String) - } - - return []byte("{}"), nil // no data in oneOf schemas => empty JSON object -} - -// Get the actual instance -func (obj *AllowedAddressesInner) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -type NullableAllowedAddressesInner struct { - value *AllowedAddressesInner - isSet bool -} - -func (v NullableAllowedAddressesInner) Get() *AllowedAddressesInner { - return v.value -} - -func (v *NullableAllowedAddressesInner) Set(val *AllowedAddressesInner) { - v.value = val - v.isSet = true -} - -func (v NullableAllowedAddressesInner) IsSet() bool { - return v.isSet -} - -func (v *NullableAllowedAddressesInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAllowedAddressesInner(val *AllowedAddressesInner) *NullableAllowedAddressesInner { - return &NullableAllowedAddressesInner{value: val, isSet: true} -} - -func (v NullableAllowedAddressesInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAllowedAddressesInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_allowed_addresses_inner_test.go b/services/iaasalpha/model_allowed_addresses_inner_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_allowed_addresses_inner_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_area.go b/services/iaasalpha/model_area.go deleted file mode 100644 index 5e862fb16..000000000 --- a/services/iaasalpha/model_area.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the Area type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Area{} - -/* - types and functions for defaultNameservers -*/ - -// isArray -type AreaGetDefaultNameserversAttributeType = *[]string -type AreaGetDefaultNameserversArgType = []string -type AreaGetDefaultNameserversRetType = []string - -func getAreaGetDefaultNameserversAttributeTypeOk(arg AreaGetDefaultNameserversAttributeType) (ret AreaGetDefaultNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaGetDefaultNameserversAttributeType(arg *AreaGetDefaultNameserversAttributeType, val AreaGetDefaultNameserversRetType) { - *arg = &val -} - -/* - types and functions for networkRanges -*/ - -// isArray -type AreaGetNetworkRangesAttributeType = *[]NetworkRange -type AreaGetNetworkRangesArgType = []NetworkRange -type AreaGetNetworkRangesRetType = []NetworkRange - -func getAreaGetNetworkRangesAttributeTypeOk(arg AreaGetNetworkRangesAttributeType) (ret AreaGetNetworkRangesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaGetNetworkRangesAttributeType(arg *AreaGetNetworkRangesAttributeType, val AreaGetNetworkRangesRetType) { - *arg = &val -} - -/* - types and functions for routes -*/ - -// isArray -type AreaGetRoutesAttributeType = *[]Route -type AreaGetRoutesArgType = []Route -type AreaGetRoutesRetType = []Route - -func getAreaGetRoutesAttributeTypeOk(arg AreaGetRoutesAttributeType) (ret AreaGetRoutesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaGetRoutesAttributeType(arg *AreaGetRoutesAttributeType, val AreaGetRoutesRetType) { - *arg = &val -} - -/* - types and functions for transferNetwork -*/ - -// isNotNullableString -type AreaGetTransferNetworkAttributeType = *string - -func getAreaGetTransferNetworkAttributeTypeOk(arg AreaGetTransferNetworkAttributeType) (ret AreaGetTransferNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaGetTransferNetworkAttributeType(arg *AreaGetTransferNetworkAttributeType, val AreaGetTransferNetworkRetType) { - *arg = &val -} - -type AreaGetTransferNetworkArgType = string -type AreaGetTransferNetworkRetType = string - -// Area The basic properties of a network area. -type Area struct { - // A list containing DNS Servers/Nameservers for IPv4. - DefaultNameservers AreaGetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` - // A list of network ranges. - NetworkRanges AreaGetNetworkRangesAttributeType `json:"networkRanges,omitempty"` - // A list of routes. - Routes AreaGetRoutesAttributeType `json:"routes,omitempty"` - // Classless Inter-Domain Routing (CIDR). - TransferNetwork AreaGetTransferNetworkAttributeType `json:"transferNetwork,omitempty"` -} - -// NewArea instantiates a new Area 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 NewArea() *Area { - this := Area{} - return &this -} - -// NewAreaWithDefaults instantiates a new Area 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 NewAreaWithDefaults() *Area { - this := Area{} - return &this -} - -// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *Area) GetDefaultNameservers() (res AreaGetDefaultNameserversRetType) { - 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 *Area) GetDefaultNameserversOk() (ret AreaGetDefaultNameserversRetType, ok bool) { - return getAreaGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) -} - -// HasDefaultNameservers returns a boolean if a field has been set. -func (o *Area) HasDefaultNameservers() bool { - _, ok := o.GetDefaultNameserversOk() - return ok -} - -// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *Area) SetDefaultNameservers(v AreaGetDefaultNameserversRetType) { - setAreaGetDefaultNameserversAttributeType(&o.DefaultNameservers, v) -} - -// GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. -func (o *Area) GetNetworkRanges() (res AreaGetNetworkRangesRetType) { - res, _ = o.GetNetworkRangesOk() - return -} - -// GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Area) GetNetworkRangesOk() (ret AreaGetNetworkRangesRetType, ok bool) { - return getAreaGetNetworkRangesAttributeTypeOk(o.NetworkRanges) -} - -// HasNetworkRanges returns a boolean if a field has been set. -func (o *Area) HasNetworkRanges() bool { - _, ok := o.GetNetworkRangesOk() - return ok -} - -// SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. -func (o *Area) SetNetworkRanges(v AreaGetNetworkRangesRetType) { - setAreaGetNetworkRangesAttributeType(&o.NetworkRanges, v) -} - -// GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *Area) GetRoutes() (res AreaGetRoutesRetType) { - res, _ = o.GetRoutesOk() - return -} - -// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Area) GetRoutesOk() (ret AreaGetRoutesRetType, ok bool) { - return getAreaGetRoutesAttributeTypeOk(o.Routes) -} - -// HasRoutes returns a boolean if a field has been set. -func (o *Area) HasRoutes() bool { - _, ok := o.GetRoutesOk() - return ok -} - -// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *Area) SetRoutes(v AreaGetRoutesRetType) { - setAreaGetRoutesAttributeType(&o.Routes, v) -} - -// GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. -func (o *Area) GetTransferNetwork() (res AreaGetTransferNetworkRetType) { - res, _ = o.GetTransferNetworkOk() - return -} - -// GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Area) GetTransferNetworkOk() (ret AreaGetTransferNetworkRetType, ok bool) { - return getAreaGetTransferNetworkAttributeTypeOk(o.TransferNetwork) -} - -// HasTransferNetwork returns a boolean if a field has been set. -func (o *Area) HasTransferNetwork() bool { - _, ok := o.GetTransferNetworkOk() - return ok -} - -// SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. -func (o *Area) SetTransferNetwork(v AreaGetTransferNetworkRetType) { - setAreaGetTransferNetworkAttributeType(&o.TransferNetwork, v) -} - -func (o Area) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAreaGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { - toSerialize["DefaultNameservers"] = val - } - if val, ok := getAreaGetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { - toSerialize["NetworkRanges"] = val - } - if val, ok := getAreaGetRoutesAttributeTypeOk(o.Routes); ok { - toSerialize["Routes"] = val - } - if val, ok := getAreaGetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { - toSerialize["TransferNetwork"] = val - } - return toSerialize, nil -} - -type NullableArea struct { - value *Area - isSet bool -} - -func (v NullableArea) Get() *Area { - return v.value -} - -func (v *NullableArea) Set(val *Area) { - v.value = val - v.isSet = true -} - -func (v NullableArea) IsSet() bool { - return v.isSet -} - -func (v *NullableArea) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArea(val *Area) *NullableArea { - return &NullableArea{value: val, isSet: true} -} - -func (v NullableArea) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArea) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_area_config.go b/services/iaasalpha/model_area_config.go deleted file mode 100644 index b931a9784..000000000 --- a/services/iaasalpha/model_area_config.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AreaConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AreaConfig{} - -/* - types and functions for defaultNameservers -*/ - -// isArray -type AreaConfigGetDefaultNameserversAttributeType = *[]string -type AreaConfigGetDefaultNameserversArgType = []string -type AreaConfigGetDefaultNameserversRetType = []string - -func getAreaConfigGetDefaultNameserversAttributeTypeOk(arg AreaConfigGetDefaultNameserversAttributeType) (ret AreaConfigGetDefaultNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaConfigGetDefaultNameserversAttributeType(arg *AreaConfigGetDefaultNameserversAttributeType, val AreaConfigGetDefaultNameserversRetType) { - *arg = &val -} - -/* - types and functions for networkRanges -*/ - -// isArray -type AreaConfigGetNetworkRangesAttributeType = *[]NetworkRange -type AreaConfigGetNetworkRangesArgType = []NetworkRange -type AreaConfigGetNetworkRangesRetType = []NetworkRange - -func getAreaConfigGetNetworkRangesAttributeTypeOk(arg AreaConfigGetNetworkRangesAttributeType) (ret AreaConfigGetNetworkRangesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaConfigGetNetworkRangesAttributeType(arg *AreaConfigGetNetworkRangesAttributeType, val AreaConfigGetNetworkRangesRetType) { - *arg = &val -} - -/* - types and functions for routes -*/ - -// isArray -type AreaConfigGetRoutesAttributeType = *[]Route -type AreaConfigGetRoutesArgType = []Route -type AreaConfigGetRoutesRetType = []Route - -func getAreaConfigGetRoutesAttributeTypeOk(arg AreaConfigGetRoutesAttributeType) (ret AreaConfigGetRoutesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaConfigGetRoutesAttributeType(arg *AreaConfigGetRoutesAttributeType, val AreaConfigGetRoutesRetType) { - *arg = &val -} - -/* - types and functions for transferNetwork -*/ - -// isNotNullableString -type AreaConfigGetTransferNetworkAttributeType = *string - -func getAreaConfigGetTransferNetworkAttributeTypeOk(arg AreaConfigGetTransferNetworkAttributeType) (ret AreaConfigGetTransferNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaConfigGetTransferNetworkAttributeType(arg *AreaConfigGetTransferNetworkAttributeType, val AreaConfigGetTransferNetworkRetType) { - *arg = &val -} - -type AreaConfigGetTransferNetworkArgType = string -type AreaConfigGetTransferNetworkRetType = string - -// AreaConfig The basic network area object. -type AreaConfig struct { - DefaultNameservers AreaConfigGetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` - // A list of network ranges. - // REQUIRED - NetworkRanges AreaConfigGetNetworkRangesAttributeType `json:"networkRanges" required:"true"` - // A list of routes. - Routes AreaConfigGetRoutesAttributeType `json:"routes,omitempty"` - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - TransferNetwork AreaConfigGetTransferNetworkAttributeType `json:"transferNetwork" required:"true"` -} - -type _AreaConfig AreaConfig - -// NewAreaConfig instantiates a new AreaConfig 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 NewAreaConfig(networkRanges AreaConfigGetNetworkRangesArgType, transferNetwork AreaConfigGetTransferNetworkArgType) *AreaConfig { - this := AreaConfig{} - setAreaConfigGetNetworkRangesAttributeType(&this.NetworkRanges, networkRanges) - setAreaConfigGetTransferNetworkAttributeType(&this.TransferNetwork, transferNetwork) - return &this -} - -// NewAreaConfigWithDefaults instantiates a new AreaConfig 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 NewAreaConfigWithDefaults() *AreaConfig { - this := AreaConfig{} - return &this -} - -// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *AreaConfig) GetDefaultNameservers() (res AreaConfigGetDefaultNameserversRetType) { - 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 *AreaConfig) GetDefaultNameserversOk() (ret AreaConfigGetDefaultNameserversRetType, ok bool) { - return getAreaConfigGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) -} - -// HasDefaultNameservers returns a boolean if a field has been set. -func (o *AreaConfig) HasDefaultNameservers() bool { - _, ok := o.GetDefaultNameserversOk() - return ok -} - -// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *AreaConfig) SetDefaultNameservers(v AreaConfigGetDefaultNameserversRetType) { - setAreaConfigGetDefaultNameserversAttributeType(&o.DefaultNameservers, v) -} - -// GetNetworkRanges returns the NetworkRanges field value -func (o *AreaConfig) GetNetworkRanges() (ret AreaConfigGetNetworkRangesRetType) { - 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 *AreaConfig) GetNetworkRangesOk() (ret AreaConfigGetNetworkRangesRetType, ok bool) { - return getAreaConfigGetNetworkRangesAttributeTypeOk(o.NetworkRanges) -} - -// SetNetworkRanges sets field value -func (o *AreaConfig) SetNetworkRanges(v AreaConfigGetNetworkRangesRetType) { - setAreaConfigGetNetworkRangesAttributeType(&o.NetworkRanges, v) -} - -// GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *AreaConfig) GetRoutes() (res AreaConfigGetRoutesRetType) { - res, _ = o.GetRoutesOk() - return -} - -// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AreaConfig) GetRoutesOk() (ret AreaConfigGetRoutesRetType, ok bool) { - return getAreaConfigGetRoutesAttributeTypeOk(o.Routes) -} - -// HasRoutes returns a boolean if a field has been set. -func (o *AreaConfig) HasRoutes() bool { - _, ok := o.GetRoutesOk() - return ok -} - -// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *AreaConfig) SetRoutes(v AreaConfigGetRoutesRetType) { - setAreaConfigGetRoutesAttributeType(&o.Routes, v) -} - -// GetTransferNetwork returns the TransferNetwork field value -func (o *AreaConfig) GetTransferNetwork() (ret AreaConfigGetTransferNetworkRetType) { - 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 *AreaConfig) GetTransferNetworkOk() (ret AreaConfigGetTransferNetworkRetType, ok bool) { - return getAreaConfigGetTransferNetworkAttributeTypeOk(o.TransferNetwork) -} - -// SetTransferNetwork sets field value -func (o *AreaConfig) SetTransferNetwork(v AreaConfigGetTransferNetworkRetType) { - setAreaConfigGetTransferNetworkAttributeType(&o.TransferNetwork, v) -} - -func (o AreaConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAreaConfigGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { - toSerialize["DefaultNameservers"] = val - } - if val, ok := getAreaConfigGetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { - toSerialize["NetworkRanges"] = val - } - if val, ok := getAreaConfigGetRoutesAttributeTypeOk(o.Routes); ok { - toSerialize["Routes"] = val - } - if val, ok := getAreaConfigGetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { - toSerialize["TransferNetwork"] = val - } - return toSerialize, nil -} - -type NullableAreaConfig struct { - value *AreaConfig - isSet bool -} - -func (v NullableAreaConfig) Get() *AreaConfig { - return v.value -} - -func (v *NullableAreaConfig) Set(val *AreaConfig) { - v.value = val - v.isSet = true -} - -func (v NullableAreaConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableAreaConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAreaConfig(val *AreaConfig) *NullableAreaConfig { - return &NullableAreaConfig{value: val, isSet: true} -} - -func (v NullableAreaConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAreaConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_area_config_test.go b/services/iaasalpha/model_area_config_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_area_config_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_area_id.go b/services/iaasalpha/model_area_id.go deleted file mode 100644 index 3ac3ef3f5..000000000 --- a/services/iaasalpha/model_area_id.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "fmt" -) - -// AreaId - The identifier (ID) of an area. -type AreaId struct { - StaticAreaID *StaticAreaID - String *string -} - -// StaticAreaIDAsAreaId is a convenience function that returns StaticAreaID wrapped in AreaId -func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { - return AreaId{ - StaticAreaID: v, - } -} - -// stringAsAreaId is a convenience function that returns string wrapped in AreaId -func StringAsAreaId(v *string) AreaId { - return AreaId{ - String: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *AreaId) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into StaticAreaID - err = newStrictDecoder(data).Decode(&dst.StaticAreaID) - if err == nil { - jsonStaticAreaID, _ := json.Marshal(dst.StaticAreaID) - if string(jsonStaticAreaID) == "{}" { // empty struct - dst.StaticAreaID = nil - } else { - match++ - } - } else { - dst.StaticAreaID = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - match++ - } - } else { - dst.String = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.StaticAreaID = nil - dst.String = nil - - return fmt.Errorf("data matches more than one schema in oneOf(AreaId)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(AreaId)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src AreaId) MarshalJSON() ([]byte, error) { - if src.StaticAreaID != nil { - return json.Marshal(&src.StaticAreaID) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return []byte("{}"), nil // no data in oneOf schemas => empty JSON object -} - -// Get the actual instance -func (obj *AreaId) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.StaticAreaID != nil { - return obj.StaticAreaID - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -type NullableAreaId struct { - value *AreaId - isSet bool -} - -func (v NullableAreaId) Get() *AreaId { - return v.value -} - -func (v *NullableAreaId) Set(val *AreaId) { - v.value = val - v.isSet = true -} - -func (v NullableAreaId) IsSet() bool { - return v.isSet -} - -func (v *NullableAreaId) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAreaId(val *AreaId) *NullableAreaId { - return &NullableAreaId{value: val, isSet: true} -} - -func (v NullableAreaId) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAreaId) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_area_id_test.go b/services/iaasalpha/model_area_id_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_area_id_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_area_prefix_config_ipv4.go b/services/iaasalpha/model_area_prefix_config_ipv4.go deleted file mode 100644 index d64b8debc..000000000 --- a/services/iaasalpha/model_area_prefix_config_ipv4.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AreaPrefixConfigIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AreaPrefixConfigIPv4{} - -/* - types and functions for defaultPrefixLen -*/ - -// isInteger -type AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType = *int64 -type AreaPrefixConfigIPv4GetDefaultPrefixLenArgType = int64 -type AreaPrefixConfigIPv4GetDefaultPrefixLenRetType = int64 - -func getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetDefaultPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType, val AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for maxPrefixLen -*/ - -// isInteger -type AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType = *int64 -type AreaPrefixConfigIPv4GetMaxPrefixLenArgType = int64 -type AreaPrefixConfigIPv4GetMaxPrefixLenRetType = int64 - -func getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetMaxPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaPrefixConfigIPv4GetMaxPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType, val AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for minPrefixLen -*/ - -// isInteger -type AreaPrefixConfigIPv4GetMinPrefixLenAttributeType = *int64 -type AreaPrefixConfigIPv4GetMinPrefixLenArgType = int64 -type AreaPrefixConfigIPv4GetMinPrefixLenRetType = int64 - -func getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetMinPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetMinPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAreaPrefixConfigIPv4GetMinPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetMinPrefixLenAttributeType, val AreaPrefixConfigIPv4GetMinPrefixLenRetType) { - *arg = &val -} - -// AreaPrefixConfigIPv4 The IPv4 prefix config for a network area. -type AreaPrefixConfigIPv4 struct { - // The default prefix length for networks in the network area. - DefaultPrefixLen AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` - // The maximal prefix length for networks in the network area. - MaxPrefixLen AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for networks in the network area. - MinPrefixLen AreaPrefixConfigIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` -} - -// NewAreaPrefixConfigIPv4 instantiates a new AreaPrefixConfigIPv4 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 NewAreaPrefixConfigIPv4() *AreaPrefixConfigIPv4 { - this := AreaPrefixConfigIPv4{} - return &this -} - -// NewAreaPrefixConfigIPv4WithDefaults instantiates a new AreaPrefixConfigIPv4 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 NewAreaPrefixConfigIPv4WithDefaults() *AreaPrefixConfigIPv4 { - this := AreaPrefixConfigIPv4{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - return &this -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLen() (res AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { - 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 *AreaPrefixConfigIPv4) GetDefaultPrefixLenOk() (ret AreaPrefixConfigIPv4GetDefaultPrefixLenRetType, ok bool) { - return getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *AreaPrefixConfigIPv4) HasDefaultPrefixLen() bool { - _, ok := o.GetDefaultPrefixLenOk() - return ok -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetDefaultPrefixLen(v AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { - setAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetMaxPrefixLen() (res AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { - 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 *AreaPrefixConfigIPv4) GetMaxPrefixLenOk() (ret AreaPrefixConfigIPv4GetMaxPrefixLenRetType, ok bool) { - return getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *AreaPrefixConfigIPv4) HasMaxPrefixLen() bool { - _, ok := o.GetMaxPrefixLenOk() - return ok -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetMaxPrefixLen(v AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { - setAreaPrefixConfigIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetMinPrefixLen() (res AreaPrefixConfigIPv4GetMinPrefixLenRetType) { - 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 *AreaPrefixConfigIPv4) GetMinPrefixLenOk() (ret AreaPrefixConfigIPv4GetMinPrefixLenRetType, ok bool) { - return getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *AreaPrefixConfigIPv4) HasMinPrefixLen() bool { - _, ok := o.GetMinPrefixLenOk() - return ok -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetMinPrefixLen(v AreaPrefixConfigIPv4GetMinPrefixLenRetType) { - setAreaPrefixConfigIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) -} - -func (o AreaPrefixConfigIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { - toSerialize["DefaultPrefixLen"] = val - } - if val, ok := getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { - toSerialize["MaxPrefixLen"] = val - } - if val, ok := getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { - toSerialize["MinPrefixLen"] = val - } - return toSerialize, nil -} - -type NullableAreaPrefixConfigIPv4 struct { - value *AreaPrefixConfigIPv4 - isSet bool -} - -func (v NullableAreaPrefixConfigIPv4) Get() *AreaPrefixConfigIPv4 { - return v.value -} - -func (v *NullableAreaPrefixConfigIPv4) Set(val *AreaPrefixConfigIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableAreaPrefixConfigIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableAreaPrefixConfigIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAreaPrefixConfigIPv4(val *AreaPrefixConfigIPv4) *NullableAreaPrefixConfigIPv4 { - return &NullableAreaPrefixConfigIPv4{value: val, isSet: true} -} - -func (v NullableAreaPrefixConfigIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAreaPrefixConfigIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_area_prefix_config_ipv4_test.go b/services/iaasalpha/model_area_prefix_config_ipv4_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_area_prefix_config_ipv4_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_area_test.go b/services/iaasalpha/model_area_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_area_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_availability_zone_list_response.go b/services/iaasalpha/model_availability_zone_list_response.go deleted file mode 100644 index fd1cf8b82..000000000 --- a/services/iaasalpha/model_availability_zone_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AvailabilityZoneListResponse{} - -/* - types and functions for items -*/ - -// isArray -type AvailabilityZoneListResponseGetItemsAttributeType = *[]string -type AvailabilityZoneListResponseGetItemsArgType = []string -type AvailabilityZoneListResponseGetItemsRetType = []string - -func getAvailabilityZoneListResponseGetItemsAttributeTypeOk(arg AvailabilityZoneListResponseGetItemsAttributeType) (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAvailabilityZoneListResponseGetItemsAttributeType(arg *AvailabilityZoneListResponseGetItemsAttributeType, val AvailabilityZoneListResponseGetItemsRetType) { - *arg = &val -} - -// AvailabilityZoneListResponse Availability Zone list response. -type AvailabilityZoneListResponse struct { - // A list of availability zones. - // REQUIRED - Items AvailabilityZoneListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _AvailabilityZoneListResponse AvailabilityZoneListResponse - -// NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse 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 NewAvailabilityZoneListResponse(items AvailabilityZoneListResponseGetItemsArgType) *AvailabilityZoneListResponse { - this := AvailabilityZoneListResponse{} - setAvailabilityZoneListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse 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 NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { - this := AvailabilityZoneListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *AvailabilityZoneListResponse) GetItems() (ret AvailabilityZoneListResponseGetItemsRetType) { - 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 *AvailabilityZoneListResponse) GetItemsOk() (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { - return getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *AvailabilityZoneListResponse) SetItems(v AvailabilityZoneListResponseGetItemsRetType) { - setAvailabilityZoneListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableAvailabilityZoneListResponse struct { - value *AvailabilityZoneListResponse - isSet bool -} - -func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { - return v.value -} - -func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableAvailabilityZoneListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableAvailabilityZoneListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { - return &NullableAvailabilityZoneListResponse{value: val, isSet: true} -} - -func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_availability_zone_list_response_test.go b/services/iaasalpha/model_availability_zone_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_availability_zone_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_backup.go b/services/iaasalpha/model_backup.go deleted file mode 100644 index d0ed5e1f9..000000000 --- a/services/iaasalpha/model_backup.go +++ /dev/null @@ -1,567 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Backup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Backup{} - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type BackupGetAvailabilityZoneAttributeType = *string - -func getBackupGetAvailabilityZoneAttributeTypeOk(arg BackupGetAvailabilityZoneAttributeType) (ret BackupGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetAvailabilityZoneAttributeType(arg *BackupGetAvailabilityZoneAttributeType, val BackupGetAvailabilityZoneRetType) { - *arg = &val -} - -type BackupGetAvailabilityZoneArgType = string -type BackupGetAvailabilityZoneRetType = string - -/* - types and functions for createdAt -*/ - -// isDateTime -type BackupGetCreatedAtAttributeType = *time.Time -type BackupGetCreatedAtArgType = time.Time -type BackupGetCreatedAtRetType = time.Time - -func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) (ret BackupGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, val BackupGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type BackupGetIdAttributeType = *string - -func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) { - *arg = &val -} - -type BackupGetIdArgType = string -type BackupGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type BackupGetLabelsAttributeType = *map[string]interface{} -type BackupGetLabelsArgType = map[string]interface{} -type BackupGetLabelsRetType = map[string]interface{} - -func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret BackupGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val BackupGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type BackupGetNameAttributeType = *string - -func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) { - *arg = &val -} - -type BackupGetNameArgType = string -type BackupGetNameRetType = string - -/* - types and functions for size -*/ - -// isLong -type BackupGetSizeAttributeType = *int64 -type BackupGetSizeArgType = int64 -type BackupGetSizeRetType = int64 - -func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) { - *arg = &val -} - -/* - types and functions for snapshotId -*/ - -// isNotNullableString -type BackupGetSnapshotIdAttributeType = *string - -func getBackupGetSnapshotIdAttributeTypeOk(arg BackupGetSnapshotIdAttributeType) (ret BackupGetSnapshotIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetSnapshotIdAttributeType(arg *BackupGetSnapshotIdAttributeType, val BackupGetSnapshotIdRetType) { - *arg = &val -} - -type BackupGetSnapshotIdArgType = string -type BackupGetSnapshotIdRetType = string - -/* - types and functions for status -*/ - -// isNotNullableString -type BackupGetStatusAttributeType = *string - -func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret BackupGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val BackupGetStatusRetType) { - *arg = &val -} - -type BackupGetStatusArgType = string -type BackupGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type BackupGetUpdatedAtAttributeType = *time.Time -type BackupGetUpdatedAtArgType = time.Time -type BackupGetUpdatedAtRetType = time.Time - -func getBackupGetUpdatedAtAttributeTypeOk(arg BackupGetUpdatedAtAttributeType) (ret BackupGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetUpdatedAtAttributeType(arg *BackupGetUpdatedAtAttributeType, val BackupGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type BackupGetVolumeIdAttributeType = *string - -func getBackupGetVolumeIdAttributeTypeOk(arg BackupGetVolumeIdAttributeType) (ret BackupGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupGetVolumeIdAttributeType(arg *BackupGetVolumeIdAttributeType, val BackupGetVolumeIdRetType) { - *arg = &val -} - -type BackupGetVolumeIdArgType = string -type BackupGetVolumeIdRetType = string - -// Backup Object that represents a backup. -type Backup struct { - // Object that represents an availability zone. - AvailabilityZone BackupGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` - // Date-time when resource was created. - CreatedAt BackupGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - Id BackupGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels BackupGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name BackupGetNameAttributeType `json:"name,omitempty"` - // Size in Gigabyte. - Size BackupGetSizeAttributeType `json:"size,omitempty"` - // Universally Unique Identifier (UUID). - SnapshotId BackupGetSnapshotIdAttributeType `json:"snapshotId,omitempty"` - // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. - Status BackupGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt BackupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // Universally Unique Identifier (UUID). - VolumeId BackupGetVolumeIdAttributeType `json:"volumeId,omitempty"` -} - -// NewBackup instantiates a new Backup 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 NewBackup() *Backup { - this := Backup{} - return &this -} - -// NewBackupWithDefaults instantiates a new Backup 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 NewBackupWithDefaults() *Backup { - this := Backup{} - return &this -} - -// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *Backup) GetAvailabilityZone() (res BackupGetAvailabilityZoneRetType) { - res, _ = o.GetAvailabilityZoneOk() - return -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetAvailabilityZoneOk() (ret BackupGetAvailabilityZoneRetType, ok bool) { - return getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// HasAvailabilityZone returns a boolean if a field has been set. -func (o *Backup) HasAvailabilityZone() bool { - _, ok := o.GetAvailabilityZoneOk() - return ok -} - -// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *Backup) SetAvailabilityZone(v BackupGetAvailabilityZoneRetType) { - setBackupGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Backup) GetCreatedAt() (res BackupGetCreatedAtRetType) { - 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 *Backup) GetCreatedAtOk() (ret BackupGetCreatedAtRetType, ok bool) { - return getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Backup) 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 *Backup) SetCreatedAt(v BackupGetCreatedAtRetType) { - setBackupGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Backup) GetId() (res BackupGetIdRetType) { - 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 *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) { - return getBackupGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *Backup) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Backup) SetId(v BackupGetIdRetType) { - setBackupGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Backup) GetLabels() (res BackupGetLabelsRetType) { - 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 *Backup) GetLabelsOk() (ret BackupGetLabelsRetType, ok bool) { - return getBackupGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Backup) 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 *Backup) SetLabels(v BackupGetLabelsRetType) { - setBackupGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Backup) GetName() (res BackupGetNameRetType) { - 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 *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) { - return getBackupGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *Backup) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Backup) SetName(v BackupGetNameRetType) { - setBackupGetNameAttributeType(&o.Name, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *Backup) GetSize() (res BackupGetSizeRetType) { - 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 *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) { - return getBackupGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *Backup) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Backup) SetSize(v BackupGetSizeRetType) { - setBackupGetSizeAttributeType(&o.Size, v) -} - -// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. -func (o *Backup) GetSnapshotId() (res BackupGetSnapshotIdRetType) { - res, _ = o.GetSnapshotIdOk() - return -} - -// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetSnapshotIdOk() (ret BackupGetSnapshotIdRetType, ok bool) { - return getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId) -} - -// HasSnapshotId returns a boolean if a field has been set. -func (o *Backup) HasSnapshotId() bool { - _, ok := o.GetSnapshotIdOk() - return ok -} - -// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. -func (o *Backup) SetSnapshotId(v BackupGetSnapshotIdRetType) { - setBackupGetSnapshotIdAttributeType(&o.SnapshotId, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Backup) GetStatus() (res BackupGetStatusRetType) { - 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 *Backup) GetStatusOk() (ret BackupGetStatusRetType, ok bool) { - return getBackupGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *Backup) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Backup) SetStatus(v BackupGetStatusRetType) { - setBackupGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Backup) GetUpdatedAt() (res BackupGetUpdatedAtRetType) { - 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 *Backup) GetUpdatedAtOk() (ret BackupGetUpdatedAtRetType, ok bool) { - return getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Backup) 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 *Backup) SetUpdatedAt(v BackupGetUpdatedAtRetType) { - setBackupGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *Backup) GetVolumeId() (res BackupGetVolumeIdRetType) { - res, _ = o.GetVolumeIdOk() - return -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetVolumeIdOk() (ret BackupGetVolumeIdRetType, ok bool) { - return getBackupGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// HasVolumeId returns a boolean if a field has been set. -func (o *Backup) HasVolumeId() bool { - _, ok := o.GetVolumeIdOk() - return ok -} - -// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *Backup) SetVolumeId(v BackupGetVolumeIdRetType) { - setBackupGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o Backup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getBackupGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getBackupGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getBackupGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getBackupGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId); ok { - toSerialize["SnapshotId"] = val - } - if val, ok := getBackupGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getBackupGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableBackup struct { - value *Backup - isSet bool -} - -func (v NullableBackup) Get() *Backup { - return v.value -} - -func (v *NullableBackup) Set(val *Backup) { - v.value = val - v.isSet = true -} - -func (v NullableBackup) IsSet() bool { - return v.isSet -} - -func (v *NullableBackup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBackup(val *Backup) *NullableBackup { - return &NullableBackup{value: val, isSet: true} -} - -func (v NullableBackup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBackup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_backup_list_response.go b/services/iaasalpha/model_backup_list_response.go deleted file mode 100644 index afb614728..000000000 --- a/services/iaasalpha/model_backup_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the BackupListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BackupListResponse{} - -/* - types and functions for items -*/ - -// isArray -type BackupListResponseGetItemsAttributeType = *[]Backup -type BackupListResponseGetItemsArgType = []Backup -type BackupListResponseGetItemsRetType = []Backup - -func getBackupListResponseGetItemsAttributeTypeOk(arg BackupListResponseGetItemsAttributeType) (ret BackupListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupListResponseGetItemsAttributeType(arg *BackupListResponseGetItemsAttributeType, val BackupListResponseGetItemsRetType) { - *arg = &val -} - -// BackupListResponse Backup list response. -type BackupListResponse struct { - // A list containing backup objects. - // REQUIRED - Items BackupListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _BackupListResponse BackupListResponse - -// NewBackupListResponse instantiates a new BackupListResponse 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 NewBackupListResponse(items BackupListResponseGetItemsArgType) *BackupListResponse { - this := BackupListResponse{} - setBackupListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewBackupListResponseWithDefaults instantiates a new BackupListResponse 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 NewBackupListResponseWithDefaults() *BackupListResponse { - this := BackupListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *BackupListResponse) GetItems() (ret BackupListResponseGetItemsRetType) { - 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 *BackupListResponse) GetItemsOk() (ret BackupListResponseGetItemsRetType, ok bool) { - return getBackupListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *BackupListResponse) SetItems(v BackupListResponseGetItemsRetType) { - setBackupListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o BackupListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBackupListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableBackupListResponse struct { - value *BackupListResponse - isSet bool -} - -func (v NullableBackupListResponse) Get() *BackupListResponse { - return v.value -} - -func (v *NullableBackupListResponse) Set(val *BackupListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBackupListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBackupListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { - return &NullableBackupListResponse{value: val, isSet: true} -} - -func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_backup_list_response_test.go b/services/iaasalpha/model_backup_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_backup_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_backup_source.go b/services/iaasalpha/model_backup_source.go deleted file mode 100644 index f85f045fc..000000000 --- a/services/iaasalpha/model_backup_source.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the BackupSource type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BackupSource{} - -/* - types and functions for id -*/ - -// isNotNullableString -type BackupSourceGetIdAttributeType = *string - -func getBackupSourceGetIdAttributeTypeOk(arg BackupSourceGetIdAttributeType) (ret BackupSourceGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupSourceGetIdAttributeType(arg *BackupSourceGetIdAttributeType, val BackupSourceGetIdRetType) { - *arg = &val -} - -type BackupSourceGetIdArgType = string -type BackupSourceGetIdRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type BackupSourceGetTypeAttributeType = *string - -func getBackupSourceGetTypeAttributeTypeOk(arg BackupSourceGetTypeAttributeType) (ret BackupSourceGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBackupSourceGetTypeAttributeType(arg *BackupSourceGetTypeAttributeType, val BackupSourceGetTypeRetType) { - *arg = &val -} - -type BackupSourceGetTypeArgType = string -type BackupSourceGetTypeRetType = string - -// BackupSource The source object of a backup. -type BackupSource struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Id BackupSourceGetIdAttributeType `json:"id" required:"true"` - // The source types of a backup. Possible values: `volume`, `snapshot`. - // REQUIRED - Type BackupSourceGetTypeAttributeType `json:"type" required:"true"` -} - -type _BackupSource BackupSource - -// NewBackupSource instantiates a new BackupSource 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 NewBackupSource(id BackupSourceGetIdArgType, types BackupSourceGetTypeArgType) *BackupSource { - this := BackupSource{} - setBackupSourceGetIdAttributeType(&this.Id, id) - setBackupSourceGetTypeAttributeType(&this.Type, types) - return &this -} - -// NewBackupSourceWithDefaults instantiates a new BackupSource 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 NewBackupSourceWithDefaults() *BackupSource { - this := BackupSource{} - return &this -} - -// GetId returns the Id field value -func (o *BackupSource) GetId() (ret BackupSourceGetIdRetType) { - 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 *BackupSource) GetIdOk() (ret BackupSourceGetIdRetType, ok bool) { - return getBackupSourceGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *BackupSource) SetId(v BackupSourceGetIdRetType) { - setBackupSourceGetIdAttributeType(&o.Id, v) -} - -// GetType returns the Type field value -func (o *BackupSource) GetType() (ret BackupSourceGetTypeRetType) { - 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 *BackupSource) GetTypeOk() (ret BackupSourceGetTypeRetType, ok bool) { - return getBackupSourceGetTypeAttributeTypeOk(o.Type) -} - -// SetType sets field value -func (o *BackupSource) SetType(v BackupSourceGetTypeRetType) { - setBackupSourceGetTypeAttributeType(&o.Type, v) -} - -func (o BackupSource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBackupSourceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getBackupSourceGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableBackupSource struct { - value *BackupSource - isSet bool -} - -func (v NullableBackupSource) Get() *BackupSource { - return v.value -} - -func (v *NullableBackupSource) Set(val *BackupSource) { - v.value = val - v.isSet = true -} - -func (v NullableBackupSource) IsSet() bool { - return v.isSet -} - -func (v *NullableBackupSource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { - return &NullableBackupSource{value: val, isSet: true} -} - -func (v NullableBackupSource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_backup_source_test.go b/services/iaasalpha/model_backup_source_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_backup_source_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_backup_test.go b/services/iaasalpha/model_backup_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_backup_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_base_security_group_rule.go b/services/iaasalpha/model_base_security_group_rule.go deleted file mode 100644 index 8e7811b8e..000000000 --- a/services/iaasalpha/model_base_security_group_rule.go +++ /dev/null @@ -1,517 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BaseSecurityGroupRule{} - -/* - types and functions for description -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetDescriptionAttributeType = *string - -func getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(arg BaseSecurityGroupRuleGetDescriptionAttributeType) (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetDescriptionAttributeType(arg *BaseSecurityGroupRuleGetDescriptionAttributeType, val BaseSecurityGroupRuleGetDescriptionRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetDescriptionArgType = string -type BaseSecurityGroupRuleGetDescriptionRetType = string - -/* - types and functions for direction -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetDirectionAttributeType = *string - -func getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(arg BaseSecurityGroupRuleGetDirectionAttributeType) (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetDirectionAttributeType(arg *BaseSecurityGroupRuleGetDirectionAttributeType, val BaseSecurityGroupRuleGetDirectionRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetDirectionArgType = string -type BaseSecurityGroupRuleGetDirectionRetType = string - -/* - types and functions for ethertype -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetEthertypeAttributeType = *string - -func getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(arg BaseSecurityGroupRuleGetEthertypeAttributeType) (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetEthertypeAttributeType(arg *BaseSecurityGroupRuleGetEthertypeAttributeType, val BaseSecurityGroupRuleGetEthertypeRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetEthertypeArgType = string -type BaseSecurityGroupRuleGetEthertypeRetType = string - -/* - types and functions for icmpParameters -*/ - -// isModel -type BaseSecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters -type BaseSecurityGroupRuleGetIcmpParametersArgType = ICMPParameters -type BaseSecurityGroupRuleGetIcmpParametersRetType = ICMPParameters - -func getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg BaseSecurityGroupRuleGetIcmpParametersAttributeType) (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetIcmpParametersAttributeType(arg *BaseSecurityGroupRuleGetIcmpParametersAttributeType, val BaseSecurityGroupRuleGetIcmpParametersRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetIdAttributeType = *string - -func getBaseSecurityGroupRuleGetIdAttributeTypeOk(arg BaseSecurityGroupRuleGetIdAttributeType) (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetIdAttributeType(arg *BaseSecurityGroupRuleGetIdAttributeType, val BaseSecurityGroupRuleGetIdRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetIdArgType = string -type BaseSecurityGroupRuleGetIdRetType = string - -/* - types and functions for ipRange -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetIpRangeAttributeType = *string - -func getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetIpRangeAttributeType) (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetIpRangeAttributeType(arg *BaseSecurityGroupRuleGetIpRangeAttributeType, val BaseSecurityGroupRuleGetIpRangeRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetIpRangeArgType = string -type BaseSecurityGroupRuleGetIpRangeRetType = string - -/* - types and functions for portRange -*/ - -// isModel -type BaseSecurityGroupRuleGetPortRangeAttributeType = *PortRange -type BaseSecurityGroupRuleGetPortRangeArgType = PortRange -type BaseSecurityGroupRuleGetPortRangeRetType = PortRange - -func getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetPortRangeAttributeType) (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetPortRangeAttributeType(arg *BaseSecurityGroupRuleGetPortRangeAttributeType, val BaseSecurityGroupRuleGetPortRangeRetType) { - *arg = &val -} - -/* - types and functions for remoteSecurityGroupId -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string - -func getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetRemoteSecurityGroupIdArgType = string -type BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType = string - -/* - types and functions for securityGroupId -*/ - -// isNotNullableString -type BaseSecurityGroupRuleGetSecurityGroupIdAttributeType = *string - -func getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetSecurityGroupIdRetType) { - *arg = &val -} - -type BaseSecurityGroupRuleGetSecurityGroupIdArgType = string -type BaseSecurityGroupRuleGetSecurityGroupIdRetType = string - -// BaseSecurityGroupRule The base schema for a security group rule. -type BaseSecurityGroupRule struct { - // Description Object. Allows string up to 255 Characters. - Description BaseSecurityGroupRuleGetDescriptionAttributeType `json:"description,omitempty"` - // The direction of the traffic which the rule should match. - // REQUIRED - Direction BaseSecurityGroupRuleGetDirectionAttributeType `json:"direction" required:"true"` - // The ethertype which the rule should match. - Ethertype BaseSecurityGroupRuleGetEthertypeAttributeType `json:"ethertype,omitempty"` - IcmpParameters BaseSecurityGroupRuleGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` - // Universally Unique Identifier (UUID). - Id BaseSecurityGroupRuleGetIdAttributeType `json:"id,omitempty"` - // Classless Inter-Domain Routing (CIDR). - IpRange BaseSecurityGroupRuleGetIpRangeAttributeType `json:"ipRange,omitempty"` - PortRange BaseSecurityGroupRuleGetPortRangeAttributeType `json:"portRange,omitempty"` - // Universally Unique Identifier (UUID). - RemoteSecurityGroupId BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` - // Universally Unique Identifier (UUID). - SecurityGroupId BaseSecurityGroupRuleGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` -} - -type _BaseSecurityGroupRule BaseSecurityGroupRule - -// NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule 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 NewBaseSecurityGroupRule(direction BaseSecurityGroupRuleGetDirectionArgType) *BaseSecurityGroupRule { - this := BaseSecurityGroupRule{} - setBaseSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) - return &this -} - -// NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule 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 NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { - this := BaseSecurityGroupRule{} - var ethertype string = "IPv4" - this.Ethertype = ðertype - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetDescription() (res BaseSecurityGroupRuleGetDescriptionRetType) { - 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 *BaseSecurityGroupRule) GetDescriptionOk() (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { - return getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *BaseSecurityGroupRule) SetDescription(v BaseSecurityGroupRuleGetDescriptionRetType) { - setBaseSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) -} - -// GetDirection returns the Direction field value -func (o *BaseSecurityGroupRule) GetDirection() (ret BaseSecurityGroupRuleGetDirectionRetType) { - ret, _ = o.GetDirectionOk() - return ret -} - -// GetDirectionOk returns a tuple with the Direction field value -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetDirectionOk() (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { - return getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) -} - -// SetDirection sets field value -func (o *BaseSecurityGroupRule) SetDirection(v BaseSecurityGroupRuleGetDirectionRetType) { - setBaseSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) -} - -// GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetEthertype() (res BaseSecurityGroupRuleGetEthertypeRetType) { - res, _ = o.GetEthertypeOk() - return -} - -// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetEthertypeOk() (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { - return getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) -} - -// HasEthertype returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasEthertype() bool { - _, ok := o.GetEthertypeOk() - return ok -} - -// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *BaseSecurityGroupRule) SetEthertype(v BaseSecurityGroupRuleGetEthertypeRetType) { - setBaseSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) -} - -// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetIcmpParameters() (res BaseSecurityGroupRuleGetIcmpParametersRetType) { - res, _ = o.GetIcmpParametersOk() - return -} - -// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { - return getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) -} - -// HasIcmpParameters returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { - _, ok := o.GetIcmpParametersOk() - return ok -} - -// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *BaseSecurityGroupRule) SetIcmpParameters(v BaseSecurityGroupRuleGetIcmpParametersRetType) { - setBaseSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetId() (res BaseSecurityGroupRuleGetIdRetType) { - 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 *BaseSecurityGroupRule) GetIdOk() (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { - return getBaseSecurityGroupRuleGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *BaseSecurityGroupRule) SetId(v BaseSecurityGroupRuleGetIdRetType) { - setBaseSecurityGroupRuleGetIdAttributeType(&o.Id, v) -} - -// GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetIpRange() (res BaseSecurityGroupRuleGetIpRangeRetType) { - res, _ = o.GetIpRangeOk() - return -} - -// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetIpRangeOk() (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { - return getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) -} - -// HasIpRange returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasIpRange() bool { - _, ok := o.GetIpRangeOk() - return ok -} - -// SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *BaseSecurityGroupRule) SetIpRange(v BaseSecurityGroupRuleGetIpRangeRetType) { - setBaseSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) -} - -// GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetPortRange() (res BaseSecurityGroupRuleGetPortRangeRetType) { - res, _ = o.GetPortRangeOk() - return -} - -// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetPortRangeOk() (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { - return getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) -} - -// HasPortRange returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasPortRange() bool { - _, ok := o.GetPortRangeOk() - return ok -} - -// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *BaseSecurityGroupRule) SetPortRange(v BaseSecurityGroupRuleGetPortRangeRetType) { - setBaseSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) -} - -// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() (res BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - res, _ = o.GetRemoteSecurityGroupIdOk() - return -} - -// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { - return getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) -} - -// HasRemoteSecurityGroupId returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { - _, ok := o.GetRemoteSecurityGroupIdOk() - return ok -} - -// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) -} - -// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetSecurityGroupId() (res BaseSecurityGroupRuleGetSecurityGroupIdRetType) { - res, _ = o.GetSecurityGroupIdOk() - return -} - -// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { - return getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) -} - -// HasSecurityGroupId returns a boolean if a field has been set. -func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { - _, ok := o.GetSecurityGroupIdOk() - return ok -} - -// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *BaseSecurityGroupRule) SetSecurityGroupId(v BaseSecurityGroupRuleGetSecurityGroupIdRetType) { - setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) -} - -func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction); ok { - toSerialize["Direction"] = val - } - if val, ok := getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype); ok { - toSerialize["Ethertype"] = val - } - if val, ok := getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { - toSerialize["IcmpParameters"] = val - } - if val, ok := getBaseSecurityGroupRuleGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange); ok { - toSerialize["IpRange"] = val - } - if val, ok := getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange); ok { - toSerialize["PortRange"] = val - } - if val, ok := getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { - toSerialize["RemoteSecurityGroupId"] = val - } - if val, ok := getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { - toSerialize["SecurityGroupId"] = val - } - return toSerialize, nil -} - -type NullableBaseSecurityGroupRule struct { - value *BaseSecurityGroupRule - isSet bool -} - -func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { - return v.value -} - -func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { - v.value = val - v.isSet = true -} - -func (v NullableBaseSecurityGroupRule) IsSet() bool { - return v.isSet -} - -func (v *NullableBaseSecurityGroupRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { - return &NullableBaseSecurityGroupRule{value: val, isSet: true} -} - -func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_base_security_group_rule_test.go b/services/iaasalpha/model_base_security_group_rule_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_base_security_group_rule_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_boot_volume.go b/services/iaasalpha/model_boot_volume.go deleted file mode 100644 index a9b372c6c..000000000 --- a/services/iaasalpha/model_boot_volume.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the BootVolume type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BootVolume{} - -/* - types and functions for deleteOnTermination -*/ - -// isBoolean -type BootVolumegetDeleteOnTerminationAttributeType = *bool -type BootVolumegetDeleteOnTerminationArgType = bool -type BootVolumegetDeleteOnTerminationRetType = bool - -func getBootVolumegetDeleteOnTerminationAttributeTypeOk(arg BootVolumegetDeleteOnTerminationAttributeType) (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumegetDeleteOnTerminationAttributeType(arg *BootVolumegetDeleteOnTerminationAttributeType, val BootVolumegetDeleteOnTerminationRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type BootVolumeGetIdAttributeType = *string - -func getBootVolumeGetIdAttributeTypeOk(arg BootVolumeGetIdAttributeType) (ret BootVolumeGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeGetIdAttributeType(arg *BootVolumeGetIdAttributeType, val BootVolumeGetIdRetType) { - *arg = &val -} - -type BootVolumeGetIdArgType = string -type BootVolumeGetIdRetType = string - -/* - types and functions for performanceClass -*/ - -// isNotNullableString -type BootVolumeGetPerformanceClassAttributeType = *string - -func getBootVolumeGetPerformanceClassAttributeTypeOk(arg BootVolumeGetPerformanceClassAttributeType) (ret BootVolumeGetPerformanceClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeGetPerformanceClassAttributeType(arg *BootVolumeGetPerformanceClassAttributeType, val BootVolumeGetPerformanceClassRetType) { - *arg = &val -} - -type BootVolumeGetPerformanceClassArgType = string -type BootVolumeGetPerformanceClassRetType = string - -/* - types and functions for size -*/ - -// isLong -type BootVolumeGetSizeAttributeType = *int64 -type BootVolumeGetSizeArgType = int64 -type BootVolumeGetSizeRetType = int64 - -func getBootVolumeGetSizeAttributeTypeOk(arg BootVolumeGetSizeAttributeType) (ret BootVolumeGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeGetSizeAttributeType(arg *BootVolumeGetSizeAttributeType, val BootVolumeGetSizeRetType) { - *arg = &val -} - -/* - types and functions for source -*/ - -// isModel -type BootVolumeGetSourceAttributeType = *BootVolumeSource -type BootVolumeGetSourceArgType = BootVolumeSource -type BootVolumeGetSourceRetType = BootVolumeSource - -func getBootVolumeGetSourceAttributeTypeOk(arg BootVolumeGetSourceAttributeType) (ret BootVolumeGetSourceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeGetSourceAttributeType(arg *BootVolumeGetSourceAttributeType, val BootVolumeGetSourceRetType) { - *arg = &val -} - -// BootVolume The boot device for the server. -type BootVolume struct { - // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination BootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` - // Universally Unique Identifier (UUID). - Id BootVolumeGetIdAttributeType `json:"id,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass BootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` - // Size in Gigabyte. - Size BootVolumeGetSizeAttributeType `json:"size,omitempty"` - Source BootVolumeGetSourceAttributeType `json:"source,omitempty"` -} - -// NewBootVolume instantiates a new BootVolume 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 NewBootVolume() *BootVolume { - this := BootVolume{} - return &this -} - -// NewBootVolumeWithDefaults instantiates a new BootVolume 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 NewBootVolumeWithDefaults() *BootVolume { - this := BootVolume{} - return &this -} - -// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *BootVolume) GetDeleteOnTermination() (res BootVolumegetDeleteOnTerminationRetType) { - 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 *BootVolume) GetDeleteOnTerminationOk() (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { - return getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) -} - -// HasDeleteOnTermination returns a boolean if a field has been set. -func (o *BootVolume) HasDeleteOnTermination() bool { - _, ok := o.GetDeleteOnTerminationOk() - return ok -} - -// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *BootVolume) SetDeleteOnTermination(v BootVolumegetDeleteOnTerminationRetType) { - setBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *BootVolume) GetId() (res BootVolumeGetIdRetType) { - 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 *BootVolume) GetIdOk() (ret BootVolumeGetIdRetType, ok bool) { - return getBootVolumeGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *BootVolume) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *BootVolume) SetId(v BootVolumeGetIdRetType) { - setBootVolumeGetIdAttributeType(&o.Id, v) -} - -// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *BootVolume) GetPerformanceClass() (res BootVolumeGetPerformanceClassRetType) { - 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 *BootVolume) GetPerformanceClassOk() (ret BootVolumeGetPerformanceClassRetType, ok bool) { - return getBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) -} - -// HasPerformanceClass returns a boolean if a field has been set. -func (o *BootVolume) HasPerformanceClass() bool { - _, ok := o.GetPerformanceClassOk() - return ok -} - -// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *BootVolume) SetPerformanceClass(v BootVolumeGetPerformanceClassRetType) { - setBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *BootVolume) GetSize() (res BootVolumeGetSizeRetType) { - 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 *BootVolume) GetSizeOk() (ret BootVolumeGetSizeRetType, ok bool) { - return getBootVolumeGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *BootVolume) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *BootVolume) SetSize(v BootVolumeGetSizeRetType) { - setBootVolumeGetSizeAttributeType(&o.Size, v) -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *BootVolume) GetSource() (res BootVolumeGetSourceRetType) { - 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 *BootVolume) GetSourceOk() (ret BootVolumeGetSourceRetType, ok bool) { - return getBootVolumeGetSourceAttributeTypeOk(o.Source) -} - -// HasSource returns a boolean if a field has been set. -func (o *BootVolume) HasSource() bool { - _, ok := o.GetSourceOk() - return ok -} - -// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. -func (o *BootVolume) SetSource(v BootVolumeGetSourceRetType) { - setBootVolumeGetSourceAttributeType(&o.Source, v) -} - -func (o BootVolume) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { - toSerialize["DeleteOnTermination"] = val - } - if val, ok := getBootVolumeGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { - toSerialize["PerformanceClass"] = val - } - if val, ok := getBootVolumeGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getBootVolumeGetSourceAttributeTypeOk(o.Source); ok { - toSerialize["Source"] = val - } - return toSerialize, nil -} - -type NullableBootVolume struct { - value *BootVolume - isSet bool -} - -func (v NullableBootVolume) Get() *BootVolume { - return v.value -} - -func (v *NullableBootVolume) Set(val *BootVolume) { - v.value = val - v.isSet = true -} - -func (v NullableBootVolume) IsSet() bool { - return v.isSet -} - -func (v *NullableBootVolume) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBootVolume(val *BootVolume) *NullableBootVolume { - return &NullableBootVolume{value: val, isSet: true} -} - -func (v NullableBootVolume) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBootVolume) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_boot_volume_source.go b/services/iaasalpha/model_boot_volume_source.go deleted file mode 100644 index 764201cbb..000000000 --- a/services/iaasalpha/model_boot_volume_source.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the BootVolumeSource type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BootVolumeSource{} - -/* - types and functions for id -*/ - -// isNotNullableString -type BootVolumeSourceGetIdAttributeType = *string - -func getBootVolumeSourceGetIdAttributeTypeOk(arg BootVolumeSourceGetIdAttributeType) (ret BootVolumeSourceGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeSourceGetIdAttributeType(arg *BootVolumeSourceGetIdAttributeType, val BootVolumeSourceGetIdRetType) { - *arg = &val -} - -type BootVolumeSourceGetIdArgType = string -type BootVolumeSourceGetIdRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type BootVolumeSourceGetTypeAttributeType = *string - -func getBootVolumeSourceGetTypeAttributeTypeOk(arg BootVolumeSourceGetTypeAttributeType) (ret BootVolumeSourceGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setBootVolumeSourceGetTypeAttributeType(arg *BootVolumeSourceGetTypeAttributeType, val BootVolumeSourceGetTypeRetType) { - *arg = &val -} - -type BootVolumeSourceGetTypeArgType = string -type BootVolumeSourceGetTypeRetType = string - -// BootVolumeSource struct for BootVolumeSource -type BootVolumeSource struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Id BootVolumeSourceGetIdAttributeType `json:"id" required:"true"` - // The source types of a boot volume. Possible values: `image`, `volume`. - // REQUIRED - Type BootVolumeSourceGetTypeAttributeType `json:"type" required:"true"` -} - -type _BootVolumeSource BootVolumeSource - -// NewBootVolumeSource instantiates a new BootVolumeSource 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 NewBootVolumeSource(id BootVolumeSourceGetIdArgType, types BootVolumeSourceGetTypeArgType) *BootVolumeSource { - this := BootVolumeSource{} - setBootVolumeSourceGetIdAttributeType(&this.Id, id) - setBootVolumeSourceGetTypeAttributeType(&this.Type, types) - return &this -} - -// NewBootVolumeSourceWithDefaults instantiates a new BootVolumeSource 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 NewBootVolumeSourceWithDefaults() *BootVolumeSource { - this := BootVolumeSource{} - return &this -} - -// GetId returns the Id field value -func (o *BootVolumeSource) GetId() (ret BootVolumeSourceGetIdRetType) { - 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 *BootVolumeSource) GetIdOk() (ret BootVolumeSourceGetIdRetType, ok bool) { - return getBootVolumeSourceGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *BootVolumeSource) SetId(v BootVolumeSourceGetIdRetType) { - setBootVolumeSourceGetIdAttributeType(&o.Id, v) -} - -// GetType returns the Type field value -func (o *BootVolumeSource) GetType() (ret BootVolumeSourceGetTypeRetType) { - 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 *BootVolumeSource) GetTypeOk() (ret BootVolumeSourceGetTypeRetType, ok bool) { - return getBootVolumeSourceGetTypeAttributeTypeOk(o.Type) -} - -// SetType sets field value -func (o *BootVolumeSource) SetType(v BootVolumeSourceGetTypeRetType) { - setBootVolumeSourceGetTypeAttributeType(&o.Type, v) -} - -func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBootVolumeSourceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getBootVolumeSourceGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableBootVolumeSource struct { - value *BootVolumeSource - isSet bool -} - -func (v NullableBootVolumeSource) Get() *BootVolumeSource { - return v.value -} - -func (v *NullableBootVolumeSource) Set(val *BootVolumeSource) { - v.value = val - v.isSet = true -} - -func (v NullableBootVolumeSource) IsSet() bool { - return v.isSet -} - -func (v *NullableBootVolumeSource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBootVolumeSource(val *BootVolumeSource) *NullableBootVolumeSource { - return &NullableBootVolumeSource{value: val, isSet: true} -} - -func (v NullableBootVolumeSource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBootVolumeSource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_boot_volume_source_test.go b/services/iaasalpha/model_boot_volume_source_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_boot_volume_source_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_boot_volume_test.go b/services/iaasalpha/model_boot_volume_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_boot_volume_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_affinity_group_payload.go b/services/iaasalpha/model_create_affinity_group_payload.go deleted file mode 100644 index fd3d7bbab..000000000 --- a/services/iaasalpha/model_create_affinity_group_payload.go +++ /dev/null @@ -1,269 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateAffinityGroupPayload{} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateAffinityGroupPayloadGetIdAttributeType = *string - -func getCreateAffinityGroupPayloadGetIdAttributeTypeOk(arg CreateAffinityGroupPayloadGetIdAttributeType) (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAffinityGroupPayloadGetIdAttributeType(arg *CreateAffinityGroupPayloadGetIdAttributeType, val CreateAffinityGroupPayloadGetIdRetType) { - *arg = &val -} - -type CreateAffinityGroupPayloadGetIdArgType = string -type CreateAffinityGroupPayloadGetIdRetType = string - -/* - types and functions for members -*/ - -// isArray -type CreateAffinityGroupPayloadGetMembersAttributeType = *[]string -type CreateAffinityGroupPayloadGetMembersArgType = []string -type CreateAffinityGroupPayloadGetMembersRetType = []string - -func getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(arg CreateAffinityGroupPayloadGetMembersAttributeType) (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAffinityGroupPayloadGetMembersAttributeType(arg *CreateAffinityGroupPayloadGetMembersAttributeType, val CreateAffinityGroupPayloadGetMembersRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateAffinityGroupPayloadGetNameAttributeType = *string - -func getCreateAffinityGroupPayloadGetNameAttributeTypeOk(arg CreateAffinityGroupPayloadGetNameAttributeType) (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAffinityGroupPayloadGetNameAttributeType(arg *CreateAffinityGroupPayloadGetNameAttributeType, val CreateAffinityGroupPayloadGetNameRetType) { - *arg = &val -} - -type CreateAffinityGroupPayloadGetNameArgType = string -type CreateAffinityGroupPayloadGetNameRetType = string - -/* - types and functions for policy -*/ - -// isNotNullableString -type CreateAffinityGroupPayloadGetPolicyAttributeType = *string - -func getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(arg CreateAffinityGroupPayloadGetPolicyAttributeType) (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAffinityGroupPayloadGetPolicyAttributeType(arg *CreateAffinityGroupPayloadGetPolicyAttributeType, val CreateAffinityGroupPayloadGetPolicyRetType) { - *arg = &val -} - -type CreateAffinityGroupPayloadGetPolicyArgType = string -type CreateAffinityGroupPayloadGetPolicyRetType = string - -// CreateAffinityGroupPayload Definition of an affinity group. -type CreateAffinityGroupPayload struct { - // Universally Unique Identifier (UUID). - Id CreateAffinityGroupPayloadGetIdAttributeType `json:"id,omitempty"` - // The servers that are part of the affinity group. - Members CreateAffinityGroupPayloadGetMembersAttributeType `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name CreateAffinityGroupPayloadGetNameAttributeType `json:"name" required:"true"` - // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. - // REQUIRED - Policy CreateAffinityGroupPayloadGetPolicyAttributeType `json:"policy" required:"true"` -} - -type _CreateAffinityGroupPayload CreateAffinityGroupPayload - -// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayload(name CreateAffinityGroupPayloadGetNameArgType, policy CreateAffinityGroupPayloadGetPolicyArgType) *CreateAffinityGroupPayload { - this := CreateAffinityGroupPayload{} - setCreateAffinityGroupPayloadGetNameAttributeType(&this.Name, name) - setCreateAffinityGroupPayloadGetPolicyAttributeType(&this.Policy, policy) - return &this -} - -// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { - this := CreateAffinityGroupPayload{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateAffinityGroupPayload) GetId() (res CreateAffinityGroupPayloadGetIdRetType) { - 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 *CreateAffinityGroupPayload) GetIdOk() (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { - return getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateAffinityGroupPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateAffinityGroupPayload) SetId(v CreateAffinityGroupPayloadGetIdRetType) { - setCreateAffinityGroupPayloadGetIdAttributeType(&o.Id, v) -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *CreateAffinityGroupPayload) GetMembers() (res CreateAffinityGroupPayloadGetMembersRetType) { - res, _ = o.GetMembersOk() - return -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateAffinityGroupPayload) GetMembersOk() (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { - return getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members) -} - -// HasMembers returns a boolean if a field has been set. -func (o *CreateAffinityGroupPayload) HasMembers() bool { - _, ok := o.GetMembersOk() - return ok -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *CreateAffinityGroupPayload) SetMembers(v CreateAffinityGroupPayloadGetMembersRetType) { - setCreateAffinityGroupPayloadGetMembersAttributeType(&o.Members, v) -} - -// GetName returns the Name field value -func (o *CreateAffinityGroupPayload) GetName() (ret CreateAffinityGroupPayloadGetNameRetType) { - 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 *CreateAffinityGroupPayload) GetNameOk() (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { - return getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *CreateAffinityGroupPayload) SetName(v CreateAffinityGroupPayloadGetNameRetType) { - setCreateAffinityGroupPayloadGetNameAttributeType(&o.Name, v) -} - -// GetPolicy returns the Policy field value -func (o *CreateAffinityGroupPayload) GetPolicy() (ret CreateAffinityGroupPayloadGetPolicyRetType) { - ret, _ = o.GetPolicyOk() - return ret -} - -// GetPolicyOk returns a tuple with the Policy field value -// and a boolean to check if the value has been set. -func (o *CreateAffinityGroupPayload) GetPolicyOk() (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { - return getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy) -} - -// SetPolicy sets field value -func (o *CreateAffinityGroupPayload) SetPolicy(v CreateAffinityGroupPayloadGetPolicyRetType) { - setCreateAffinityGroupPayloadGetPolicyAttributeType(&o.Policy, v) -} - -func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members); ok { - toSerialize["Members"] = val - } - if val, ok := getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy); ok { - toSerialize["Policy"] = val - } - return toSerialize, nil -} - -type NullableCreateAffinityGroupPayload struct { - value *CreateAffinityGroupPayload - isSet bool -} - -func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { - return v.value -} - -func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateAffinityGroupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateAffinityGroupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { - return &NullableCreateAffinityGroupPayload{value: val, isSet: true} -} - -func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_affinity_group_payload_test.go b/services/iaasalpha/model_create_affinity_group_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_affinity_group_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_area_address_family.go b/services/iaasalpha/model_create_area_address_family.go deleted file mode 100644 index 2b98d0f85..000000000 --- a/services/iaasalpha/model_create_area_address_family.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateAreaAddressFamily type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateAreaAddressFamily{} - -/* - types and functions for ipv4 -*/ - -// isModel -type CreateAreaAddressFamilyGetIpv4AttributeType = *CreateAreaIPv4 -type CreateAreaAddressFamilyGetIpv4ArgType = CreateAreaIPv4 -type CreateAreaAddressFamilyGetIpv4RetType = CreateAreaIPv4 - -func getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(arg CreateAreaAddressFamilyGetIpv4AttributeType) (ret CreateAreaAddressFamilyGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaAddressFamilyGetIpv4AttributeType(arg *CreateAreaAddressFamilyGetIpv4AttributeType, val CreateAreaAddressFamilyGetIpv4RetType) { - *arg = &val -} - -// CreateAreaAddressFamily The addressFamily object for a area create request. -type CreateAreaAddressFamily struct { - Ipv4 CreateAreaAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` -} - -// NewCreateAreaAddressFamily instantiates a new CreateAreaAddressFamily 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 NewCreateAreaAddressFamily() *CreateAreaAddressFamily { - this := CreateAreaAddressFamily{} - return &this -} - -// NewCreateAreaAddressFamilyWithDefaults instantiates a new CreateAreaAddressFamily 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 NewCreateAreaAddressFamilyWithDefaults() *CreateAreaAddressFamily { - this := CreateAreaAddressFamily{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateAreaAddressFamily) GetIpv4() (res CreateAreaAddressFamilyGetIpv4RetType) { - 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 *CreateAreaAddressFamily) GetIpv4Ok() (ret CreateAreaAddressFamilyGetIpv4RetType, ok bool) { - return getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateAreaAddressFamily) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given CreateAreaIPv4 and assigns it to the Ipv4 field. -func (o *CreateAreaAddressFamily) SetIpv4(v CreateAreaAddressFamilyGetIpv4RetType) { - setCreateAreaAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) -} - -func (o CreateAreaAddressFamily) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - return toSerialize, nil -} - -type NullableCreateAreaAddressFamily struct { - value *CreateAreaAddressFamily - isSet bool -} - -func (v NullableCreateAreaAddressFamily) Get() *CreateAreaAddressFamily { - return v.value -} - -func (v *NullableCreateAreaAddressFamily) Set(val *CreateAreaAddressFamily) { - v.value = val - v.isSet = true -} - -func (v NullableCreateAreaAddressFamily) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateAreaAddressFamily) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateAreaAddressFamily(val *CreateAreaAddressFamily) *NullableCreateAreaAddressFamily { - return &NullableCreateAreaAddressFamily{value: val, isSet: true} -} - -func (v NullableCreateAreaAddressFamily) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateAreaAddressFamily) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_area_address_family_test.go b/services/iaasalpha/model_create_area_address_family_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_area_address_family_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_area_ipv4.go b/services/iaasalpha/model_create_area_ipv4.go deleted file mode 100644 index be1247cab..000000000 --- a/services/iaasalpha/model_create_area_ipv4.go +++ /dev/null @@ -1,416 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateAreaIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateAreaIPv4{} - -/* - types and functions for defaultNameservers -*/ - -// isArray -type CreateAreaIPv4GetDefaultNameserversAttributeType = *[]string -type CreateAreaIPv4GetDefaultNameserversArgType = []string -type CreateAreaIPv4GetDefaultNameserversRetType = []string - -func getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(arg CreateAreaIPv4GetDefaultNameserversAttributeType) (ret CreateAreaIPv4GetDefaultNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetDefaultNameserversAttributeType(arg *CreateAreaIPv4GetDefaultNameserversAttributeType, val CreateAreaIPv4GetDefaultNameserversRetType) { - *arg = &val -} - -/* - types and functions for networkRanges -*/ - -// isArray -type CreateAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange -type CreateAreaIPv4GetNetworkRangesArgType = []NetworkRange -type CreateAreaIPv4GetNetworkRangesRetType = []NetworkRange - -func getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(arg CreateAreaIPv4GetNetworkRangesAttributeType) (ret CreateAreaIPv4GetNetworkRangesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetNetworkRangesAttributeType(arg *CreateAreaIPv4GetNetworkRangesAttributeType, val CreateAreaIPv4GetNetworkRangesRetType) { - *arg = &val -} - -/* - types and functions for routes -*/ - -// isArray -type CreateAreaIPv4GetRoutesAttributeType = *[]Route -type CreateAreaIPv4GetRoutesArgType = []Route -type CreateAreaIPv4GetRoutesRetType = []Route - -func getCreateAreaIPv4GetRoutesAttributeTypeOk(arg CreateAreaIPv4GetRoutesAttributeType) (ret CreateAreaIPv4GetRoutesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetRoutesAttributeType(arg *CreateAreaIPv4GetRoutesAttributeType, val CreateAreaIPv4GetRoutesRetType) { - *arg = &val -} - -/* - types and functions for transferNetwork -*/ - -// isNotNullableString -type CreateAreaIPv4GetTransferNetworkAttributeType = *string - -func getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(arg CreateAreaIPv4GetTransferNetworkAttributeType) (ret CreateAreaIPv4GetTransferNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetTransferNetworkAttributeType(arg *CreateAreaIPv4GetTransferNetworkAttributeType, val CreateAreaIPv4GetTransferNetworkRetType) { - *arg = &val -} - -type CreateAreaIPv4GetTransferNetworkArgType = string -type CreateAreaIPv4GetTransferNetworkRetType = string - -/* - types and functions for defaultPrefixLen -*/ - -// isInteger -type CreateAreaIPv4GetDefaultPrefixLenAttributeType = *int64 -type CreateAreaIPv4GetDefaultPrefixLenArgType = int64 -type CreateAreaIPv4GetDefaultPrefixLenRetType = int64 - -func getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetDefaultPrefixLenAttributeType) (ret CreateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetDefaultPrefixLenAttributeType(arg *CreateAreaIPv4GetDefaultPrefixLenAttributeType, val CreateAreaIPv4GetDefaultPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for maxPrefixLen -*/ - -// isInteger -type CreateAreaIPv4GetMaxPrefixLenAttributeType = *int64 -type CreateAreaIPv4GetMaxPrefixLenArgType = int64 -type CreateAreaIPv4GetMaxPrefixLenRetType = int64 - -func getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetMaxPrefixLenAttributeType) (ret CreateAreaIPv4GetMaxPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetMaxPrefixLenAttributeType(arg *CreateAreaIPv4GetMaxPrefixLenAttributeType, val CreateAreaIPv4GetMaxPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for minPrefixLen -*/ - -// isInteger -type CreateAreaIPv4GetMinPrefixLenAttributeType = *int64 -type CreateAreaIPv4GetMinPrefixLenArgType = int64 -type CreateAreaIPv4GetMinPrefixLenRetType = int64 - -func getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetMinPrefixLenAttributeType) (ret CreateAreaIPv4GetMinPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateAreaIPv4GetMinPrefixLenAttributeType(arg *CreateAreaIPv4GetMinPrefixLenAttributeType, val CreateAreaIPv4GetMinPrefixLenRetType) { - *arg = &val -} - -// CreateAreaIPv4 The config object for a IPv4 network area. -type CreateAreaIPv4 struct { - DefaultNameservers CreateAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` - // A list of network ranges. - // REQUIRED - NetworkRanges CreateAreaIPv4GetNetworkRangesAttributeType `json:"networkRanges" required:"true"` - // A list of routes. - Routes CreateAreaIPv4GetRoutesAttributeType `json:"routes,omitempty"` - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - TransferNetwork CreateAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork" required:"true"` - // The default prefix length for networks in the network area. - DefaultPrefixLen CreateAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` - // The maximal prefix length for networks in the network area. - MaxPrefixLen CreateAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for networks in the network area. - MinPrefixLen CreateAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` -} - -type _CreateAreaIPv4 CreateAreaIPv4 - -// NewCreateAreaIPv4 instantiates a new CreateAreaIPv4 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 NewCreateAreaIPv4(networkRanges CreateAreaIPv4GetNetworkRangesArgType, transferNetwork CreateAreaIPv4GetTransferNetworkArgType) *CreateAreaIPv4 { - this := CreateAreaIPv4{} - setCreateAreaIPv4GetNetworkRangesAttributeType(&this.NetworkRanges, networkRanges) - setCreateAreaIPv4GetTransferNetworkAttributeType(&this.TransferNetwork, transferNetwork) - return &this -} - -// NewCreateAreaIPv4WithDefaults instantiates a new CreateAreaIPv4 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 NewCreateAreaIPv4WithDefaults() *CreateAreaIPv4 { - this := CreateAreaIPv4{} - 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 *CreateAreaIPv4) GetDefaultNameservers() (res CreateAreaIPv4GetDefaultNameserversRetType) { - 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 *CreateAreaIPv4) GetDefaultNameserversOk() (ret CreateAreaIPv4GetDefaultNameserversRetType, ok bool) { - return getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) -} - -// HasDefaultNameservers returns a boolean if a field has been set. -func (o *CreateAreaIPv4) HasDefaultNameservers() bool { - _, ok := o.GetDefaultNameserversOk() - return ok -} - -// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *CreateAreaIPv4) SetDefaultNameservers(v CreateAreaIPv4GetDefaultNameserversRetType) { - setCreateAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) -} - -// GetNetworkRanges returns the NetworkRanges field value -func (o *CreateAreaIPv4) GetNetworkRanges() (ret CreateAreaIPv4GetNetworkRangesRetType) { - 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 *CreateAreaIPv4) GetNetworkRangesOk() (ret CreateAreaIPv4GetNetworkRangesRetType, ok bool) { - return getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) -} - -// SetNetworkRanges sets field value -func (o *CreateAreaIPv4) SetNetworkRanges(v CreateAreaIPv4GetNetworkRangesRetType) { - setCreateAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) -} - -// GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetRoutes() (res CreateAreaIPv4GetRoutesRetType) { - res, _ = o.GetRoutesOk() - return -} - -// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetRoutesOk() (ret CreateAreaIPv4GetRoutesRetType, ok bool) { - return getCreateAreaIPv4GetRoutesAttributeTypeOk(o.Routes) -} - -// HasRoutes returns a boolean if a field has been set. -func (o *CreateAreaIPv4) HasRoutes() bool { - _, ok := o.GetRoutesOk() - return ok -} - -// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *CreateAreaIPv4) SetRoutes(v CreateAreaIPv4GetRoutesRetType) { - setCreateAreaIPv4GetRoutesAttributeType(&o.Routes, v) -} - -// GetTransferNetwork returns the TransferNetwork field value -func (o *CreateAreaIPv4) GetTransferNetwork() (ret CreateAreaIPv4GetTransferNetworkRetType) { - 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 *CreateAreaIPv4) GetTransferNetworkOk() (ret CreateAreaIPv4GetTransferNetworkRetType, ok bool) { - return getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) -} - -// SetTransferNetwork sets field value -func (o *CreateAreaIPv4) SetTransferNetwork(v CreateAreaIPv4GetTransferNetworkRetType) { - setCreateAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetDefaultPrefixLen() (res CreateAreaIPv4GetDefaultPrefixLenRetType) { - 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 *CreateAreaIPv4) GetDefaultPrefixLenOk() (ret CreateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - return getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *CreateAreaIPv4) HasDefaultPrefixLen() bool { - _, ok := o.GetDefaultPrefixLenOk() - return ok -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *CreateAreaIPv4) SetDefaultPrefixLen(v CreateAreaIPv4GetDefaultPrefixLenRetType) { - setCreateAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetMaxPrefixLen() (res CreateAreaIPv4GetMaxPrefixLenRetType) { - 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 *CreateAreaIPv4) GetMaxPrefixLenOk() (ret CreateAreaIPv4GetMaxPrefixLenRetType, ok bool) { - return getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *CreateAreaIPv4) HasMaxPrefixLen() bool { - _, ok := o.GetMaxPrefixLenOk() - return ok -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *CreateAreaIPv4) SetMaxPrefixLen(v CreateAreaIPv4GetMaxPrefixLenRetType) { - setCreateAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetMinPrefixLen() (res CreateAreaIPv4GetMinPrefixLenRetType) { - 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 *CreateAreaIPv4) GetMinPrefixLenOk() (ret CreateAreaIPv4GetMinPrefixLenRetType, ok bool) { - return getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *CreateAreaIPv4) HasMinPrefixLen() bool { - _, ok := o.GetMinPrefixLenOk() - return ok -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *CreateAreaIPv4) SetMinPrefixLen(v CreateAreaIPv4GetMinPrefixLenRetType) { - setCreateAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) -} - -func (o CreateAreaIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { - toSerialize["DefaultNameservers"] = val - } - if val, ok := getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { - toSerialize["NetworkRanges"] = val - } - if val, ok := getCreateAreaIPv4GetRoutesAttributeTypeOk(o.Routes); ok { - toSerialize["Routes"] = val - } - if val, ok := getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { - toSerialize["TransferNetwork"] = val - } - if val, ok := getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { - toSerialize["DefaultPrefixLen"] = val - } - if val, ok := getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { - toSerialize["MaxPrefixLen"] = val - } - if val, ok := getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { - toSerialize["MinPrefixLen"] = val - } - return toSerialize, nil -} - -type NullableCreateAreaIPv4 struct { - value *CreateAreaIPv4 - isSet bool -} - -func (v NullableCreateAreaIPv4) Get() *CreateAreaIPv4 { - return v.value -} - -func (v *NullableCreateAreaIPv4) Set(val *CreateAreaIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableCreateAreaIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateAreaIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateAreaIPv4(val *CreateAreaIPv4) *NullableCreateAreaIPv4 { - return &NullableCreateAreaIPv4{value: val, isSet: true} -} - -func (v NullableCreateAreaIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateAreaIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_area_ipv4_test.go b/services/iaasalpha/model_create_area_ipv4_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_area_ipv4_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_backup_payload.go b/services/iaasalpha/model_create_backup_payload.go deleted file mode 100644 index 3b0ffeeac..000000000 --- a/services/iaasalpha/model_create_backup_payload.go +++ /dev/null @@ -1,222 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateBackupPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type CreateBackupPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateBackupPayloadGetLabelsArgType = map[string]interface{} -type CreateBackupPayloadGetLabelsRetType = map[string]interface{} - -func getCreateBackupPayloadGetLabelsAttributeTypeOk(arg CreateBackupPayloadGetLabelsAttributeType) (ret CreateBackupPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateBackupPayloadGetLabelsAttributeType(arg *CreateBackupPayloadGetLabelsAttributeType, val CreateBackupPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateBackupPayloadGetNameAttributeType = *string - -func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetNameAttributeType) (ret CreateBackupPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateBackupPayloadGetNameAttributeType(arg *CreateBackupPayloadGetNameAttributeType, val CreateBackupPayloadGetNameRetType) { - *arg = &val -} - -type CreateBackupPayloadGetNameArgType = string -type CreateBackupPayloadGetNameRetType = string - -/* - types and functions for source -*/ - -// isModel -type CreateBackupPayloadGetSourceAttributeType = *BackupSource -type CreateBackupPayloadGetSourceArgType = BackupSource -type CreateBackupPayloadGetSourceRetType = BackupSource - -func getCreateBackupPayloadGetSourceAttributeTypeOk(arg CreateBackupPayloadGetSourceAttributeType) (ret CreateBackupPayloadGetSourceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateBackupPayloadGetSourceAttributeType(arg *CreateBackupPayloadGetSourceAttributeType, val CreateBackupPayloadGetSourceRetType) { - *arg = &val -} - -// CreateBackupPayload Object that represents a backup create request body. -type CreateBackupPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name CreateBackupPayloadGetNameAttributeType `json:"name,omitempty"` - // REQUIRED - Source CreateBackupPayloadGetSourceAttributeType `json:"source" required:"true"` -} - -type _CreateBackupPayload CreateBackupPayload - -// NewCreateBackupPayload instantiates a new CreateBackupPayload 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 NewCreateBackupPayload(source CreateBackupPayloadGetSourceArgType) *CreateBackupPayload { - this := CreateBackupPayload{} - setCreateBackupPayloadGetSourceAttributeType(&this.Source, source) - return &this -} - -// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload 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 NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { - this := CreateBackupPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateBackupPayload) GetLabels() (res CreateBackupPayloadGetLabelsRetType) { - 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 *CreateBackupPayload) GetLabelsOk() (ret CreateBackupPayloadGetLabelsRetType, ok bool) { - return getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateBackupPayload) 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 *CreateBackupPayload) SetLabels(v CreateBackupPayloadGetLabelsRetType) { - setCreateBackupPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateBackupPayload) GetName() (res CreateBackupPayloadGetNameRetType) { - 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 *CreateBackupPayload) GetNameOk() (ret CreateBackupPayloadGetNameRetType, ok bool) { - return getCreateBackupPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateBackupPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateBackupPayload) SetName(v CreateBackupPayloadGetNameRetType) { - setCreateBackupPayloadGetNameAttributeType(&o.Name, v) -} - -// GetSource returns the Source field value -func (o *CreateBackupPayload) GetSource() (ret CreateBackupPayloadGetSourceRetType) { - ret, _ = o.GetSourceOk() - return ret -} - -// GetSourceOk returns a tuple with the Source field value -// and a boolean to check if the value has been set. -func (o *CreateBackupPayload) GetSourceOk() (ret CreateBackupPayloadGetSourceRetType, ok bool) { - return getCreateBackupPayloadGetSourceAttributeTypeOk(o.Source) -} - -// SetSource sets field value -func (o *CreateBackupPayload) SetSource(v CreateBackupPayloadGetSourceRetType) { - setCreateBackupPayloadGetSourceAttributeType(&o.Source, v) -} - -func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateBackupPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateBackupPayloadGetSourceAttributeTypeOk(o.Source); ok { - toSerialize["Source"] = val - } - return toSerialize, nil -} - -type NullableCreateBackupPayload struct { - value *CreateBackupPayload - isSet bool -} - -func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { - return v.value -} - -func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateBackupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateBackupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { - return &NullableCreateBackupPayload{value: val, isSet: true} -} - -func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_backup_payload_test.go b/services/iaasalpha/model_create_backup_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_backup_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_image_payload.go b/services/iaasalpha/model_create_image_payload.go deleted file mode 100644 index bca4be8ff..000000000 --- a/services/iaasalpha/model_create_image_payload.go +++ /dev/null @@ -1,798 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateImagePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateImagePayload{} - -/* - types and functions for checksum -*/ - -// isModel -type CreateImagePayloadGetChecksumAttributeType = *ImageChecksum -type CreateImagePayloadGetChecksumArgType = ImageChecksum -type CreateImagePayloadGetChecksumRetType = ImageChecksum - -func getCreateImagePayloadGetChecksumAttributeTypeOk(arg CreateImagePayloadGetChecksumAttributeType) (ret CreateImagePayloadGetChecksumRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetChecksumAttributeType(arg *CreateImagePayloadGetChecksumAttributeType, val CreateImagePayloadGetChecksumRetType) { - *arg = &val -} - -/* - types and functions for config -*/ - -// isModel -type CreateImagePayloadGetConfigAttributeType = *ImageConfig -type CreateImagePayloadGetConfigArgType = ImageConfig -type CreateImagePayloadGetConfigRetType = ImageConfig - -func getCreateImagePayloadGetConfigAttributeTypeOk(arg CreateImagePayloadGetConfigAttributeType) (ret CreateImagePayloadGetConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetConfigAttributeType(arg *CreateImagePayloadGetConfigAttributeType, val CreateImagePayloadGetConfigRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateImagePayloadGetCreatedAtAttributeType = *time.Time -type CreateImagePayloadGetCreatedAtArgType = time.Time -type CreateImagePayloadGetCreatedAtRetType = time.Time - -func getCreateImagePayloadGetCreatedAtAttributeTypeOk(arg CreateImagePayloadGetCreatedAtAttributeType) (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetCreatedAtAttributeType(arg *CreateImagePayloadGetCreatedAtAttributeType, val CreateImagePayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for diskFormat -*/ - -// isNotNullableString -type CreateImagePayloadGetDiskFormatAttributeType = *string - -func getCreateImagePayloadGetDiskFormatAttributeTypeOk(arg CreateImagePayloadGetDiskFormatAttributeType) (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetDiskFormatAttributeType(arg *CreateImagePayloadGetDiskFormatAttributeType, val CreateImagePayloadGetDiskFormatRetType) { - *arg = &val -} - -type CreateImagePayloadGetDiskFormatArgType = string -type CreateImagePayloadGetDiskFormatRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateImagePayloadGetIdAttributeType = *string - -func getCreateImagePayloadGetIdAttributeTypeOk(arg CreateImagePayloadGetIdAttributeType) (ret CreateImagePayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetIdAttributeType(arg *CreateImagePayloadGetIdAttributeType, val CreateImagePayloadGetIdRetType) { - *arg = &val -} - -type CreateImagePayloadGetIdArgType = string -type CreateImagePayloadGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateImagePayloadGetLabelsAttributeType = *map[string]interface{} -type CreateImagePayloadGetLabelsArgType = map[string]interface{} -type CreateImagePayloadGetLabelsRetType = map[string]interface{} - -func getCreateImagePayloadGetLabelsAttributeTypeOk(arg CreateImagePayloadGetLabelsAttributeType) (ret CreateImagePayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetLabelsAttributeType(arg *CreateImagePayloadGetLabelsAttributeType, val CreateImagePayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for minDiskSize -*/ - -// isLong -type CreateImagePayloadGetMinDiskSizeAttributeType = *int64 -type CreateImagePayloadGetMinDiskSizeArgType = int64 -type CreateImagePayloadGetMinDiskSizeRetType = int64 - -func getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(arg CreateImagePayloadGetMinDiskSizeAttributeType) (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetMinDiskSizeAttributeType(arg *CreateImagePayloadGetMinDiskSizeAttributeType, val CreateImagePayloadGetMinDiskSizeRetType) { - *arg = &val -} - -/* - types and functions for minRam -*/ - -// isLong -type CreateImagePayloadGetMinRamAttributeType = *int64 -type CreateImagePayloadGetMinRamArgType = int64 -type CreateImagePayloadGetMinRamRetType = int64 - -func getCreateImagePayloadGetMinRamAttributeTypeOk(arg CreateImagePayloadGetMinRamAttributeType) (ret CreateImagePayloadGetMinRamRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetMinRamAttributeType(arg *CreateImagePayloadGetMinRamAttributeType, val CreateImagePayloadGetMinRamRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateImagePayloadGetNameAttributeType = *string - -func getCreateImagePayloadGetNameAttributeTypeOk(arg CreateImagePayloadGetNameAttributeType) (ret CreateImagePayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetNameAttributeType(arg *CreateImagePayloadGetNameAttributeType, val CreateImagePayloadGetNameRetType) { - *arg = &val -} - -type CreateImagePayloadGetNameArgType = string -type CreateImagePayloadGetNameRetType = string - -/* - types and functions for owner -*/ - -// isNotNullableString -type CreateImagePayloadGetOwnerAttributeType = *string - -func getCreateImagePayloadGetOwnerAttributeTypeOk(arg CreateImagePayloadGetOwnerAttributeType) (ret CreateImagePayloadGetOwnerRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetOwnerAttributeType(arg *CreateImagePayloadGetOwnerAttributeType, val CreateImagePayloadGetOwnerRetType) { - *arg = &val -} - -type CreateImagePayloadGetOwnerArgType = string -type CreateImagePayloadGetOwnerRetType = string - -/* - types and functions for protected -*/ - -// isBoolean -type CreateImagePayloadgetProtectedAttributeType = *bool -type CreateImagePayloadgetProtectedArgType = bool -type CreateImagePayloadgetProtectedRetType = bool - -func getCreateImagePayloadgetProtectedAttributeTypeOk(arg CreateImagePayloadgetProtectedAttributeType) (ret CreateImagePayloadgetProtectedRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadgetProtectedAttributeType(arg *CreateImagePayloadgetProtectedAttributeType, val CreateImagePayloadgetProtectedRetType) { - *arg = &val -} - -/* - types and functions for scope -*/ - -// isNotNullableString -type CreateImagePayloadGetScopeAttributeType = *string - -func getCreateImagePayloadGetScopeAttributeTypeOk(arg CreateImagePayloadGetScopeAttributeType) (ret CreateImagePayloadGetScopeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetScopeAttributeType(arg *CreateImagePayloadGetScopeAttributeType, val CreateImagePayloadGetScopeRetType) { - *arg = &val -} - -type CreateImagePayloadGetScopeArgType = string -type CreateImagePayloadGetScopeRetType = string - -/* - types and functions for size -*/ - -// isLong -type CreateImagePayloadGetSizeAttributeType = *int64 -type CreateImagePayloadGetSizeArgType = int64 -type CreateImagePayloadGetSizeRetType = int64 - -func getCreateImagePayloadGetSizeAttributeTypeOk(arg CreateImagePayloadGetSizeAttributeType) (ret CreateImagePayloadGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetSizeAttributeType(arg *CreateImagePayloadGetSizeAttributeType, val CreateImagePayloadGetSizeRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateImagePayloadGetStatusAttributeType = *string - -func getCreateImagePayloadGetStatusAttributeTypeOk(arg CreateImagePayloadGetStatusAttributeType) (ret CreateImagePayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetStatusAttributeType(arg *CreateImagePayloadGetStatusAttributeType, val CreateImagePayloadGetStatusRetType) { - *arg = &val -} - -type CreateImagePayloadGetStatusArgType = string -type CreateImagePayloadGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateImagePayloadGetUpdatedAtAttributeType = *time.Time -type CreateImagePayloadGetUpdatedAtArgType = time.Time -type CreateImagePayloadGetUpdatedAtRetType = time.Time - -func getCreateImagePayloadGetUpdatedAtAttributeTypeOk(arg CreateImagePayloadGetUpdatedAtAttributeType) (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateImagePayloadGetUpdatedAtAttributeType(arg *CreateImagePayloadGetUpdatedAtAttributeType, val CreateImagePayloadGetUpdatedAtRetType) { - *arg = &val -} - -// CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). -type CreateImagePayload struct { - Checksum CreateImagePayloadGetChecksumAttributeType `json:"checksum,omitempty"` - Config CreateImagePayloadGetConfigAttributeType `json:"config,omitempty"` - // Date-time when resource was created. - CreatedAt CreateImagePayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. - // REQUIRED - DiskFormat CreateImagePayloadGetDiskFormatAttributeType `json:"diskFormat" required:"true"` - // Universally Unique Identifier (UUID). - Id CreateImagePayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Size in Gigabyte. - MinDiskSize CreateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` - // Size in Megabyte. - MinRam CreateImagePayloadGetMinRamAttributeType `json:"minRam,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name CreateImagePayloadGetNameAttributeType `json:"name" required:"true"` - // Universally Unique Identifier (UUID). - Owner CreateImagePayloadGetOwnerAttributeType `json:"owner,omitempty"` - Protected CreateImagePayloadgetProtectedAttributeType `json:"protected,omitempty"` - // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. - Scope CreateImagePayloadGetScopeAttributeType `json:"scope,omitempty"` - // Size in bytes. - Size CreateImagePayloadGetSizeAttributeType `json:"size,omitempty"` - // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. - Status CreateImagePayloadGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt CreateImagePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _CreateImagePayload CreateImagePayload - -// NewCreateImagePayload instantiates a new CreateImagePayload 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 NewCreateImagePayload(diskFormat CreateImagePayloadGetDiskFormatArgType, name CreateImagePayloadGetNameArgType) *CreateImagePayload { - this := CreateImagePayload{} - setCreateImagePayloadGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) - setCreateImagePayloadGetNameAttributeType(&this.Name, name) - return &this -} - -// NewCreateImagePayloadWithDefaults instantiates a new CreateImagePayload 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 NewCreateImagePayloadWithDefaults() *CreateImagePayload { - this := CreateImagePayload{} - return &this -} - -// GetChecksum returns the Checksum field value if set, zero value otherwise. -func (o *CreateImagePayload) GetChecksum() (res CreateImagePayloadGetChecksumRetType) { - res, _ = o.GetChecksumOk() - return -} - -// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetChecksumOk() (ret CreateImagePayloadGetChecksumRetType, ok bool) { - return getCreateImagePayloadGetChecksumAttributeTypeOk(o.Checksum) -} - -// HasChecksum returns a boolean if a field has been set. -func (o *CreateImagePayload) HasChecksum() bool { - _, ok := o.GetChecksumOk() - return ok -} - -// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. -func (o *CreateImagePayload) SetChecksum(v CreateImagePayloadGetChecksumRetType) { - setCreateImagePayloadGetChecksumAttributeType(&o.Checksum, v) -} - -// GetConfig returns the Config field value if set, zero value otherwise. -func (o *CreateImagePayload) GetConfig() (res CreateImagePayloadGetConfigRetType) { - res, _ = o.GetConfigOk() - return -} - -// GetConfigOk returns a tuple with the Config field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetConfigOk() (ret CreateImagePayloadGetConfigRetType, ok bool) { - return getCreateImagePayloadGetConfigAttributeTypeOk(o.Config) -} - -// HasConfig returns a boolean if a field has been set. -func (o *CreateImagePayload) HasConfig() bool { - _, ok := o.GetConfigOk() - return ok -} - -// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *CreateImagePayload) SetConfig(v CreateImagePayloadGetConfigRetType) { - setCreateImagePayloadGetConfigAttributeType(&o.Config, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateImagePayload) GetCreatedAt() (res CreateImagePayloadGetCreatedAtRetType) { - 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 *CreateImagePayload) GetCreatedAtOk() (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { - return getCreateImagePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateImagePayload) 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 *CreateImagePayload) SetCreatedAt(v CreateImagePayloadGetCreatedAtRetType) { - setCreateImagePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDiskFormat returns the DiskFormat field value -func (o *CreateImagePayload) GetDiskFormat() (ret CreateImagePayloadGetDiskFormatRetType) { - ret, _ = o.GetDiskFormatOk() - return ret -} - -// GetDiskFormatOk returns a tuple with the DiskFormat field value -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetDiskFormatOk() (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { - return getCreateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) -} - -// SetDiskFormat sets field value -func (o *CreateImagePayload) SetDiskFormat(v CreateImagePayloadGetDiskFormatRetType) { - setCreateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateImagePayload) GetId() (res CreateImagePayloadGetIdRetType) { - 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 *CreateImagePayload) GetIdOk() (ret CreateImagePayloadGetIdRetType, ok bool) { - return getCreateImagePayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateImagePayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateImagePayload) SetId(v CreateImagePayloadGetIdRetType) { - setCreateImagePayloadGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateImagePayload) GetLabels() (res CreateImagePayloadGetLabelsRetType) { - 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 *CreateImagePayload) GetLabelsOk() (ret CreateImagePayloadGetLabelsRetType, ok bool) { - return getCreateImagePayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateImagePayload) 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 *CreateImagePayload) SetLabels(v CreateImagePayloadGetLabelsRetType) { - setCreateImagePayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *CreateImagePayload) GetMinDiskSize() (res CreateImagePayloadGetMinDiskSizeRetType) { - res, _ = o.GetMinDiskSizeOk() - return -} - -// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetMinDiskSizeOk() (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { - return getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) -} - -// HasMinDiskSize returns a boolean if a field has been set. -func (o *CreateImagePayload) HasMinDiskSize() bool { - _, ok := o.GetMinDiskSizeOk() - return ok -} - -// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *CreateImagePayload) SetMinDiskSize(v CreateImagePayloadGetMinDiskSizeRetType) { - setCreateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) -} - -// GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *CreateImagePayload) GetMinRam() (res CreateImagePayloadGetMinRamRetType) { - res, _ = o.GetMinRamOk() - return -} - -// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetMinRamOk() (ret CreateImagePayloadGetMinRamRetType, ok bool) { - return getCreateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) -} - -// HasMinRam returns a boolean if a field has been set. -func (o *CreateImagePayload) HasMinRam() bool { - _, ok := o.GetMinRamOk() - return ok -} - -// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *CreateImagePayload) SetMinRam(v CreateImagePayloadGetMinRamRetType) { - setCreateImagePayloadGetMinRamAttributeType(&o.MinRam, v) -} - -// GetName returns the Name field value -func (o *CreateImagePayload) GetName() (ret CreateImagePayloadGetNameRetType) { - 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 *CreateImagePayload) GetNameOk() (ret CreateImagePayloadGetNameRetType, ok bool) { - return getCreateImagePayloadGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *CreateImagePayload) SetName(v CreateImagePayloadGetNameRetType) { - setCreateImagePayloadGetNameAttributeType(&o.Name, v) -} - -// GetOwner returns the Owner field value if set, zero value otherwise. -func (o *CreateImagePayload) GetOwner() (res CreateImagePayloadGetOwnerRetType) { - res, _ = o.GetOwnerOk() - return -} - -// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetOwnerOk() (ret CreateImagePayloadGetOwnerRetType, ok bool) { - return getCreateImagePayloadGetOwnerAttributeTypeOk(o.Owner) -} - -// HasOwner returns a boolean if a field has been set. -func (o *CreateImagePayload) HasOwner() bool { - _, ok := o.GetOwnerOk() - return ok -} - -// SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *CreateImagePayload) SetOwner(v CreateImagePayloadGetOwnerRetType) { - setCreateImagePayloadGetOwnerAttributeType(&o.Owner, v) -} - -// GetProtected returns the Protected field value if set, zero value otherwise. -func (o *CreateImagePayload) GetProtected() (res CreateImagePayloadgetProtectedRetType) { - res, _ = o.GetProtectedOk() - return -} - -// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetProtectedOk() (ret CreateImagePayloadgetProtectedRetType, ok bool) { - return getCreateImagePayloadgetProtectedAttributeTypeOk(o.Protected) -} - -// HasProtected returns a boolean if a field has been set. -func (o *CreateImagePayload) HasProtected() bool { - _, ok := o.GetProtectedOk() - return ok -} - -// SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *CreateImagePayload) SetProtected(v CreateImagePayloadgetProtectedRetType) { - setCreateImagePayloadgetProtectedAttributeType(&o.Protected, v) -} - -// GetScope returns the Scope field value if set, zero value otherwise. -func (o *CreateImagePayload) GetScope() (res CreateImagePayloadGetScopeRetType) { - res, _ = o.GetScopeOk() - return -} - -// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetScopeOk() (ret CreateImagePayloadGetScopeRetType, ok bool) { - return getCreateImagePayloadGetScopeAttributeTypeOk(o.Scope) -} - -// HasScope returns a boolean if a field has been set. -func (o *CreateImagePayload) HasScope() bool { - _, ok := o.GetScopeOk() - return ok -} - -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *CreateImagePayload) SetScope(v CreateImagePayloadGetScopeRetType) { - setCreateImagePayloadGetScopeAttributeType(&o.Scope, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateImagePayload) GetSize() (res CreateImagePayloadGetSizeRetType) { - 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 *CreateImagePayload) GetSizeOk() (ret CreateImagePayloadGetSizeRetType, ok bool) { - return getCreateImagePayloadGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *CreateImagePayload) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *CreateImagePayload) SetSize(v CreateImagePayloadGetSizeRetType) { - setCreateImagePayloadGetSizeAttributeType(&o.Size, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateImagePayload) GetStatus() (res CreateImagePayloadGetStatusRetType) { - 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 *CreateImagePayload) GetStatusOk() (ret CreateImagePayloadGetStatusRetType, ok bool) { - return getCreateImagePayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateImagePayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateImagePayload) SetStatus(v CreateImagePayloadGetStatusRetType) { - setCreateImagePayloadGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateImagePayload) GetUpdatedAt() (res CreateImagePayloadGetUpdatedAtRetType) { - 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 *CreateImagePayload) GetUpdatedAtOk() (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { - return getCreateImagePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateImagePayload) 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 *CreateImagePayload) SetUpdatedAt(v CreateImagePayloadGetUpdatedAtRetType) { - setCreateImagePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateImagePayloadGetChecksumAttributeTypeOk(o.Checksum); ok { - toSerialize["Checksum"] = val - } - if val, ok := getCreateImagePayloadGetConfigAttributeTypeOk(o.Config); ok { - toSerialize["Config"] = val - } - if val, ok := getCreateImagePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { - toSerialize["DiskFormat"] = val - } - if val, ok := getCreateImagePayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateImagePayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { - toSerialize["MinDiskSize"] = val - } - if val, ok := getCreateImagePayloadGetMinRamAttributeTypeOk(o.MinRam); ok { - toSerialize["MinRam"] = val - } - if val, ok := getCreateImagePayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateImagePayloadGetOwnerAttributeTypeOk(o.Owner); ok { - toSerialize["Owner"] = val - } - if val, ok := getCreateImagePayloadgetProtectedAttributeTypeOk(o.Protected); ok { - toSerialize["Protected"] = val - } - if val, ok := getCreateImagePayloadGetScopeAttributeTypeOk(o.Scope); ok { - toSerialize["Scope"] = val - } - if val, ok := getCreateImagePayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getCreateImagePayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getCreateImagePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableCreateImagePayload struct { - value *CreateImagePayload - isSet bool -} - -func (v NullableCreateImagePayload) Get() *CreateImagePayload { - return v.value -} - -func (v *NullableCreateImagePayload) Set(val *CreateImagePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateImagePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateImagePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateImagePayload(val *CreateImagePayload) *NullableCreateImagePayload { - return &NullableCreateImagePayload{value: val, isSet: true} -} - -func (v NullableCreateImagePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateImagePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_image_payload_test.go b/services/iaasalpha/model_create_image_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_image_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_key_pair_payload.go b/services/iaasalpha/model_create_key_pair_payload.go deleted file mode 100644 index 7aa597228..000000000 --- a/services/iaasalpha/model_create_key_pair_payload.go +++ /dev/null @@ -1,370 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateKeyPairPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateKeyPairPayload{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateKeyPairPayloadGetCreatedAtAttributeType = *time.Time -type CreateKeyPairPayloadGetCreatedAtArgType = time.Time -type CreateKeyPairPayloadGetCreatedAtRetType = time.Time - -func getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetCreatedAtAttributeType) (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetCreatedAtAttributeType(arg *CreateKeyPairPayloadGetCreatedAtAttributeType, val CreateKeyPairPayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for fingerprint -*/ - -// isNotNullableString -type CreateKeyPairPayloadGetFingerprintAttributeType = *string - -func getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(arg CreateKeyPairPayloadGetFingerprintAttributeType) (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetFingerprintAttributeType(arg *CreateKeyPairPayloadGetFingerprintAttributeType, val CreateKeyPairPayloadGetFingerprintRetType) { - *arg = &val -} - -type CreateKeyPairPayloadGetFingerprintArgType = string -type CreateKeyPairPayloadGetFingerprintRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateKeyPairPayloadGetLabelsArgType = map[string]interface{} -type CreateKeyPairPayloadGetLabelsRetType = map[string]interface{} - -func getCreateKeyPairPayloadGetLabelsAttributeTypeOk(arg CreateKeyPairPayloadGetLabelsAttributeType) (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetLabelsAttributeType(arg *CreateKeyPairPayloadGetLabelsAttributeType, val CreateKeyPairPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateKeyPairPayloadGetNameAttributeType = *string - -func getCreateKeyPairPayloadGetNameAttributeTypeOk(arg CreateKeyPairPayloadGetNameAttributeType) (ret CreateKeyPairPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetNameAttributeType(arg *CreateKeyPairPayloadGetNameAttributeType, val CreateKeyPairPayloadGetNameRetType) { - *arg = &val -} - -type CreateKeyPairPayloadGetNameArgType = string -type CreateKeyPairPayloadGetNameRetType = string - -/* - types and functions for publicKey -*/ - -// isNotNullableString -type CreateKeyPairPayloadGetPublicKeyAttributeType = *string - -func getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(arg CreateKeyPairPayloadGetPublicKeyAttributeType) (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetPublicKeyAttributeType(arg *CreateKeyPairPayloadGetPublicKeyAttributeType, val CreateKeyPairPayloadGetPublicKeyRetType) { - *arg = &val -} - -type CreateKeyPairPayloadGetPublicKeyArgType = string -type CreateKeyPairPayloadGetPublicKeyRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateKeyPairPayloadGetUpdatedAtAttributeType = *time.Time -type CreateKeyPairPayloadGetUpdatedAtArgType = time.Time -type CreateKeyPairPayloadGetUpdatedAtRetType = time.Time - -func getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetUpdatedAtAttributeType) (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateKeyPairPayloadGetUpdatedAtAttributeType(arg *CreateKeyPairPayloadGetUpdatedAtAttributeType, val CreateKeyPairPayloadGetUpdatedAtRetType) { - *arg = &val -} - -// CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. -type CreateKeyPairPayload struct { - // Date-time when resource was created. - CreatedAt CreateKeyPairPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Object that represents an SSH keypair MD5 fingerprint. - Fingerprint CreateKeyPairPayloadGetFingerprintAttributeType `json:"fingerprint,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - Name CreateKeyPairPayloadGetNameAttributeType `json:"name,omitempty"` - // Object that represents a public SSH key. - // REQUIRED - PublicKey CreateKeyPairPayloadGetPublicKeyAttributeType `json:"publicKey" required:"true"` - // Date-time when resource was last updated. - UpdatedAt CreateKeyPairPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _CreateKeyPairPayload CreateKeyPairPayload - -// NewCreateKeyPairPayload instantiates a new CreateKeyPairPayload 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 NewCreateKeyPairPayload(publicKey CreateKeyPairPayloadGetPublicKeyArgType) *CreateKeyPairPayload { - this := CreateKeyPairPayload{} - setCreateKeyPairPayloadGetPublicKeyAttributeType(&this.PublicKey, publicKey) - return &this -} - -// NewCreateKeyPairPayloadWithDefaults instantiates a new CreateKeyPairPayload 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 NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { - this := CreateKeyPairPayload{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetCreatedAt() (res CreateKeyPairPayloadGetCreatedAtRetType) { - 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 *CreateKeyPairPayload) GetCreatedAtOk() (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { - return getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateKeyPairPayload) 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 *CreateKeyPairPayload) SetCreatedAt(v CreateKeyPairPayloadGetCreatedAtRetType) { - setCreateKeyPairPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetFingerprint() (res CreateKeyPairPayloadGetFingerprintRetType) { - res, _ = o.GetFingerprintOk() - return -} - -// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetFingerprintOk() (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { - return getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(o.Fingerprint) -} - -// HasFingerprint returns a boolean if a field has been set. -func (o *CreateKeyPairPayload) HasFingerprint() bool { - _, ok := o.GetFingerprintOk() - return ok -} - -// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. -func (o *CreateKeyPairPayload) SetFingerprint(v CreateKeyPairPayloadGetFingerprintRetType) { - setCreateKeyPairPayloadGetFingerprintAttributeType(&o.Fingerprint, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetLabels() (res CreateKeyPairPayloadGetLabelsRetType) { - 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 *CreateKeyPairPayload) GetLabelsOk() (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { - return getCreateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateKeyPairPayload) 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 *CreateKeyPairPayload) SetLabels(v CreateKeyPairPayloadGetLabelsRetType) { - setCreateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetName() (res CreateKeyPairPayloadGetNameRetType) { - 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 *CreateKeyPairPayload) GetNameOk() (ret CreateKeyPairPayloadGetNameRetType, ok bool) { - return getCreateKeyPairPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateKeyPairPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateKeyPairPayload) SetName(v CreateKeyPairPayloadGetNameRetType) { - setCreateKeyPairPayloadGetNameAttributeType(&o.Name, v) -} - -// GetPublicKey returns the PublicKey field value -func (o *CreateKeyPairPayload) GetPublicKey() (ret CreateKeyPairPayloadGetPublicKeyRetType) { - ret, _ = o.GetPublicKeyOk() - return ret -} - -// GetPublicKeyOk returns a tuple with the PublicKey field value -// and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetPublicKeyOk() (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { - return getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(o.PublicKey) -} - -// SetPublicKey sets field value -func (o *CreateKeyPairPayload) SetPublicKey(v CreateKeyPairPayloadGetPublicKeyRetType) { - setCreateKeyPairPayloadGetPublicKeyAttributeType(&o.PublicKey, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetUpdatedAt() (res CreateKeyPairPayloadGetUpdatedAtRetType) { - 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 *CreateKeyPairPayload) GetUpdatedAtOk() (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { - return getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateKeyPairPayload) 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 *CreateKeyPairPayload) SetUpdatedAt(v CreateKeyPairPayloadGetUpdatedAtRetType) { - setCreateKeyPairPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(o.Fingerprint); ok { - toSerialize["Fingerprint"] = val - } - if val, ok := getCreateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateKeyPairPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(o.PublicKey); ok { - toSerialize["PublicKey"] = val - } - if val, ok := getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableCreateKeyPairPayload struct { - value *CreateKeyPairPayload - isSet bool -} - -func (v NullableCreateKeyPairPayload) Get() *CreateKeyPairPayload { - return v.value -} - -func (v *NullableCreateKeyPairPayload) Set(val *CreateKeyPairPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateKeyPairPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateKeyPairPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateKeyPairPayload(val *CreateKeyPairPayload) *NullableCreateKeyPairPayload { - return &NullableCreateKeyPairPayload{value: val, isSet: true} -} - -func (v NullableCreateKeyPairPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateKeyPairPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_key_pair_payload_test.go b/services/iaasalpha/model_create_key_pair_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_key_pair_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_address_family.go b/services/iaasalpha/model_create_network_address_family.go deleted file mode 100644 index 1c9c7865c..000000000 --- a/services/iaasalpha/model_create_network_address_family.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNetworkAddressFamily type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkAddressFamily{} - -/* - types and functions for ipv4 -*/ - -// isModel -type CreateNetworkAddressFamilyGetIpv4AttributeType = *CreateNetworkIPv4Body -type CreateNetworkAddressFamilyGetIpv4ArgType = CreateNetworkIPv4Body -type CreateNetworkAddressFamilyGetIpv4RetType = CreateNetworkIPv4Body - -func getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(arg CreateNetworkAddressFamilyGetIpv4AttributeType) (ret CreateNetworkAddressFamilyGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAddressFamilyGetIpv4AttributeType(arg *CreateNetworkAddressFamilyGetIpv4AttributeType, val CreateNetworkAddressFamilyGetIpv4RetType) { - *arg = &val -} - -/* - types and functions for ipv6 -*/ - -// isModel -type CreateNetworkAddressFamilyGetIpv6AttributeType = *CreateNetworkIPv6Body -type CreateNetworkAddressFamilyGetIpv6ArgType = CreateNetworkIPv6Body -type CreateNetworkAddressFamilyGetIpv6RetType = CreateNetworkIPv6Body - -func getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(arg CreateNetworkAddressFamilyGetIpv6AttributeType) (ret CreateNetworkAddressFamilyGetIpv6RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAddressFamilyGetIpv6AttributeType(arg *CreateNetworkAddressFamilyGetIpv6AttributeType, val CreateNetworkAddressFamilyGetIpv6RetType) { - *arg = &val -} - -// CreateNetworkAddressFamily The addressFamily object for a network create request. -type CreateNetworkAddressFamily struct { - Ipv4 CreateNetworkAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` - Ipv6 CreateNetworkAddressFamilyGetIpv6AttributeType `json:"ipv6,omitempty"` -} - -// NewCreateNetworkAddressFamily instantiates a new CreateNetworkAddressFamily 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 NewCreateNetworkAddressFamily() *CreateNetworkAddressFamily { - this := CreateNetworkAddressFamily{} - return &this -} - -// NewCreateNetworkAddressFamilyWithDefaults instantiates a new CreateNetworkAddressFamily 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 NewCreateNetworkAddressFamilyWithDefaults() *CreateNetworkAddressFamily { - this := CreateNetworkAddressFamily{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAddressFamily) GetIpv4() (res CreateNetworkAddressFamilyGetIpv4RetType) { - 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 *CreateNetworkAddressFamily) GetIpv4Ok() (ret CreateNetworkAddressFamilyGetIpv4RetType, ok bool) { - return getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateNetworkAddressFamily) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given CreateNetworkIPv4Body and assigns it to the Ipv4 field. -func (o *CreateNetworkAddressFamily) SetIpv4(v CreateNetworkAddressFamilyGetIpv4RetType) { - setCreateNetworkAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *CreateNetworkAddressFamily) GetIpv6() (res CreateNetworkAddressFamilyGetIpv6RetType) { - 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 *CreateNetworkAddressFamily) GetIpv6Ok() (ret CreateNetworkAddressFamilyGetIpv6RetType, ok bool) { - return getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6) -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *CreateNetworkAddressFamily) HasIpv6() bool { - _, ok := o.GetIpv6Ok() - return ok -} - -// SetIpv6 gets a reference to the given CreateNetworkIPv6Body and assigns it to the Ipv6 field. -func (o *CreateNetworkAddressFamily) SetIpv6(v CreateNetworkAddressFamilyGetIpv6RetType) { - setCreateNetworkAddressFamilyGetIpv6AttributeType(&o.Ipv6, v) -} - -func (o CreateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - if val, ok := getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6); ok { - toSerialize["Ipv6"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkAddressFamily struct { - value *CreateNetworkAddressFamily - isSet bool -} - -func (v NullableCreateNetworkAddressFamily) Get() *CreateNetworkAddressFamily { - return v.value -} - -func (v *NullableCreateNetworkAddressFamily) Set(val *CreateNetworkAddressFamily) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkAddressFamily) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkAddressFamily) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkAddressFamily(val *CreateNetworkAddressFamily) *NullableCreateNetworkAddressFamily { - return &NullableCreateNetworkAddressFamily{value: val, isSet: true} -} - -func (v NullableCreateNetworkAddressFamily) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkAddressFamily) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_address_family_test.go b/services/iaasalpha/model_create_network_address_family_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_address_family_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_area_payload.go b/services/iaasalpha/model_create_network_area_payload.go deleted file mode 100644 index 1d3fbb676..000000000 --- a/services/iaasalpha/model_create_network_area_payload.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// 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 -*/ - -// isFreeform -type CreateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} -type CreateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} - -func getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg CreateNetworkAreaPayloadGetLabelsAttributeType) (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAreaPayloadGetLabelsAttributeType(arg *CreateNetworkAreaPayloadGetLabelsAttributeType, val CreateNetworkAreaPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateNetworkAreaPayloadGetNameAttributeType = *string - -func getCreateNetworkAreaPayloadGetNameAttributeTypeOk(arg CreateNetworkAreaPayloadGetNameAttributeType) (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAreaPayloadGetNameAttributeType(arg *CreateNetworkAreaPayloadGetNameAttributeType, val CreateNetworkAreaPayloadGetNameRetType) { - *arg = &val -} - -type CreateNetworkAreaPayloadGetNameArgType = string -type CreateNetworkAreaPayloadGetNameRetType = string - -// CreateNetworkAreaPayload struct for CreateNetworkAreaPayload -type CreateNetworkAreaPayload struct { - // REQUIRED - AddressFamily CreateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily" required:"true"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name CreateNetworkAreaPayloadGetNameAttributeType `json:"name" required:"true"` -} - -type _CreateNetworkAreaPayload CreateNetworkAreaPayload - -// NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload 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 NewCreateNetworkAreaPayload(addressFamily CreateNetworkAreaPayloadGetAddressFamilyArgType, name CreateNetworkAreaPayloadGetNameArgType) *CreateNetworkAreaPayload { - this := CreateNetworkAreaPayload{} - setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(&this.AddressFamily, addressFamily) - setCreateNetworkAreaPayloadGetNameAttributeType(&this.Name, name) - return &this -} - -// NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload 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 NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { - this := 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() - 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 *CreateNetworkAreaPayload) GetLabelsOk() (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { - return getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateNetworkAreaPayload) 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 *CreateNetworkAreaPayload) SetLabels(v CreateNetworkAreaPayloadGetLabelsRetType) { - setCreateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value -func (o *CreateNetworkAreaPayload) GetName() (ret CreateNetworkAreaPayloadGetNameRetType) { - 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 *CreateNetworkAreaPayload) GetNameOk() (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { - return getCreateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *CreateNetworkAreaPayload) SetName(v CreateNetworkAreaPayloadGetNameRetType) { - setCreateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) -} - -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 - } - if val, ok := getCreateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkAreaPayload struct { - value *CreateNetworkAreaPayload - isSet bool -} - -func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { - return v.value -} - -func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkAreaPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkAreaPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { - return &NullableCreateNetworkAreaPayload{value: val, isSet: true} -} - -func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_area_payload_test.go b/services/iaasalpha/model_create_network_area_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_area_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_area_range_payload.go b/services/iaasalpha/model_create_network_area_range_payload.go deleted file mode 100644 index 9425b9edf..000000000 --- a/services/iaasalpha/model_create_network_area_range_payload.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkAreaRangePayload{} - -/* - types and functions for ipv4 -*/ - -// isArray -type CreateNetworkAreaRangePayloadGetIpv4AttributeType = *[]NetworkRange -type CreateNetworkAreaRangePayloadGetIpv4ArgType = []NetworkRange -type CreateNetworkAreaRangePayloadGetIpv4RetType = []NetworkRange - -func getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRangePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAreaRangePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRangePayloadGetIpv4AttributeType, val CreateNetworkAreaRangePayloadGetIpv4RetType) { - *arg = &val -} - -// CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload -type CreateNetworkAreaRangePayload struct { - // A list of network ranges. - Ipv4 CreateNetworkAreaRangePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` -} - -// NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload 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 NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { - this := CreateNetworkAreaRangePayload{} - return &this -} - -// NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload 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 NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { - this := CreateNetworkAreaRangePayload{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAreaRangePayload) GetIpv4() (res CreateNetworkAreaRangePayloadGetIpv4RetType) { - 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 *CreateNetworkAreaRangePayload) GetIpv4Ok() (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { - return getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. -func (o *CreateNetworkAreaRangePayload) SetIpv4(v CreateNetworkAreaRangePayloadGetIpv4RetType) { - setCreateNetworkAreaRangePayloadGetIpv4AttributeType(&o.Ipv4, v) -} - -func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkAreaRangePayload struct { - value *CreateNetworkAreaRangePayload - isSet bool -} - -func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { - return v.value -} - -func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkAreaRangePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { - return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} -} - -func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_area_range_payload_test.go b/services/iaasalpha/model_create_network_area_range_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_area_range_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_area_route_payload.go b/services/iaasalpha/model_create_network_area_route_payload.go deleted file mode 100644 index cd6cf7deb..000000000 --- a/services/iaasalpha/model_create_network_area_route_payload.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkAreaRoutePayload{} - -/* - types and functions for ipv4 -*/ - -// isArray -type CreateNetworkAreaRoutePayloadGetIpv4AttributeType = *[]Route -type CreateNetworkAreaRoutePayloadGetIpv4ArgType = []Route -type CreateNetworkAreaRoutePayloadGetIpv4RetType = []Route - -func getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRoutePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRoutePayloadGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAreaRoutePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRoutePayloadGetIpv4AttributeType, val CreateNetworkAreaRoutePayloadGetIpv4RetType) { - *arg = &val -} - -// CreateNetworkAreaRoutePayload struct for CreateNetworkAreaRoutePayload -type CreateNetworkAreaRoutePayload struct { - // A list of routes. - Ipv4 CreateNetworkAreaRoutePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` -} - -// 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 { - this := CreateNetworkAreaRoutePayload{} - return &this -} - -// NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload 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 NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { - this := CreateNetworkAreaRoutePayload{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAreaRoutePayload) GetIpv4() (res CreateNetworkAreaRoutePayloadGetIpv4RetType) { - 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 *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 -} - -// 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) -} - -func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkAreaRoutePayload struct { - value *CreateNetworkAreaRoutePayload - isSet bool -} - -func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { - return v.value -} - -func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkAreaRoutePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { - return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} -} - -func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_area_route_payload_test.go b/services/iaasalpha/model_create_network_area_route_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_area_route_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_ipv4.go b/services/iaasalpha/model_create_network_ipv4.go new file mode 100644 index 000000000..1ebf7d50c --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv4.go @@ -0,0 +1,145 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 + // try to unmarshal data into CreateNetworkIPv4WithPrefix + err = newStrictDecoder(data).Decode(&dst.CreateNetworkIPv4WithPrefix) + if err == nil { + jsonCreateNetworkIPv4WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefix) + if string(jsonCreateNetworkIPv4WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv4WithPrefixLength + err = newStrictDecoder(data).Decode(&dst.CreateNetworkIPv4WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv4WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefixLength) + if string(jsonCreateNetworkIPv4WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefixLength = nil + } + + 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/iaasalpha/model_create_network_ipv4_body.go b/services/iaasalpha/model_create_network_ipv4_body.go deleted file mode 100644 index 8a34e59db..000000000 --- a/services/iaasalpha/model_create_network_ipv4_body.go +++ /dev/null @@ -1,288 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNetworkIPv4Body type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv4Body{} - -/* - types and functions for gateway -*/ - -// isNullableString -type CreateNetworkIPv4BodyGetGatewayAttributeType = *NullableString - -func getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg CreateNetworkIPv4BodyGetGatewayAttributeType) (ret CreateNetworkIPv4BodyGetGatewayRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setCreateNetworkIPv4BodyGetGatewayAttributeType(arg *CreateNetworkIPv4BodyGetGatewayAttributeType, val CreateNetworkIPv4BodyGetGatewayRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type CreateNetworkIPv4BodyGetGatewayArgType = *string -type CreateNetworkIPv4BodyGetGatewayRetType = *string - -/* - types and functions for nameservers -*/ - -// isArray -type CreateNetworkIPv4BodyGetNameserversAttributeType = *[]string -type CreateNetworkIPv4BodyGetNameserversArgType = []string -type CreateNetworkIPv4BodyGetNameserversRetType = []string - -func getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg CreateNetworkIPv4BodyGetNameserversAttributeType) (ret CreateNetworkIPv4BodyGetNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv4BodyGetNameserversAttributeType(arg *CreateNetworkIPv4BodyGetNameserversAttributeType, val CreateNetworkIPv4BodyGetNameserversRetType) { - *arg = &val -} - -/* - types and functions for prefix -*/ - -// isNotNullableString -type CreateNetworkIPv4BodyGetPrefixAttributeType = *string - -func getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(arg CreateNetworkIPv4BodyGetPrefixAttributeType) (ret CreateNetworkIPv4BodyGetPrefixRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv4BodyGetPrefixAttributeType(arg *CreateNetworkIPv4BodyGetPrefixAttributeType, val CreateNetworkIPv4BodyGetPrefixRetType) { - *arg = &val -} - -type CreateNetworkIPv4BodyGetPrefixArgType = string -type CreateNetworkIPv4BodyGetPrefixRetType = string - -/* - types and functions for prefixLength -*/ - -// isInteger -type CreateNetworkIPv4BodyGetPrefixLengthAttributeType = *int64 -type CreateNetworkIPv4BodyGetPrefixLengthArgType = int64 -type CreateNetworkIPv4BodyGetPrefixLengthRetType = int64 - -func getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv4BodyGetPrefixLengthAttributeType) (ret CreateNetworkIPv4BodyGetPrefixLengthRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv4BodyGetPrefixLengthAttributeType(arg *CreateNetworkIPv4BodyGetPrefixLengthAttributeType, val CreateNetworkIPv4BodyGetPrefixLengthRetType) { - *arg = &val -} - -// CreateNetworkIPv4Body The config object for an IPv4 network. -type CreateNetworkIPv4Body 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. - Gateway CreateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers CreateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR). - Prefix CreateNetworkIPv4BodyGetPrefixAttributeType `json:"prefix,omitempty"` - PrefixLength CreateNetworkIPv4BodyGetPrefixLengthAttributeType `json:"prefixLength,omitempty"` -} - -// NewCreateNetworkIPv4Body instantiates a new CreateNetworkIPv4Body 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 NewCreateNetworkIPv4Body() *CreateNetworkIPv4Body { - this := CreateNetworkIPv4Body{} - return &this -} - -// NewCreateNetworkIPv4BodyWithDefaults instantiates a new CreateNetworkIPv4Body 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 NewCreateNetworkIPv4BodyWithDefaults() *CreateNetworkIPv4Body { - this := CreateNetworkIPv4Body{} - return &this -} - -// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateNetworkIPv4Body) GetGateway() (res CreateNetworkIPv4BodyGetGatewayRetType) { - 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 *CreateNetworkIPv4Body) GetGatewayOk() (ret CreateNetworkIPv4BodyGetGatewayRetType, ok bool) { - return getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway) -} - -// HasGateway returns a boolean if a field has been set. -func (o *CreateNetworkIPv4Body) HasGateway() bool { - _, ok := o.GetGatewayOk() - return ok -} - -// SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *CreateNetworkIPv4Body) SetGateway(v CreateNetworkIPv4BodyGetGatewayRetType) { - setCreateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *CreateNetworkIPv4Body) SetGatewayNil() { - o.Gateway = nil -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *CreateNetworkIPv4Body) UnsetGateway() { - o.Gateway = nil -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetNameservers() (res CreateNetworkIPv4BodyGetNameserversRetType) { - 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 *CreateNetworkIPv4Body) GetNameserversOk() (ret CreateNetworkIPv4BodyGetNameserversRetType, ok bool) { - return getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers) -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv4Body) HasNameservers() bool { - _, ok := o.GetNameserversOk() - return ok -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv4Body) SetNameservers(v CreateNetworkIPv4BodyGetNameserversRetType) { - setCreateNetworkIPv4BodyGetNameserversAttributeType(&o.Nameservers, v) -} - -// GetPrefix returns the Prefix field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetPrefix() (res CreateNetworkIPv4BodyGetPrefixRetType) { - res, _ = o.GetPrefixOk() - return -} - -// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4Body) GetPrefixOk() (ret CreateNetworkIPv4BodyGetPrefixRetType, ok bool) { - return getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(o.Prefix) -} - -// HasPrefix returns a boolean if a field has been set. -func (o *CreateNetworkIPv4Body) HasPrefix() bool { - _, ok := o.GetPrefixOk() - return ok -} - -// SetPrefix gets a reference to the given string and assigns it to the Prefix field. -func (o *CreateNetworkIPv4Body) SetPrefix(v CreateNetworkIPv4BodyGetPrefixRetType) { - setCreateNetworkIPv4BodyGetPrefixAttributeType(&o.Prefix, v) -} - -// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetPrefixLength() (res CreateNetworkIPv4BodyGetPrefixLengthRetType) { - res, _ = o.GetPrefixLengthOk() - return -} - -// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4Body) GetPrefixLengthOk() (ret CreateNetworkIPv4BodyGetPrefixLengthRetType, ok bool) { - return getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength) -} - -// HasPrefixLength returns a boolean if a field has been set. -func (o *CreateNetworkIPv4Body) HasPrefixLength() bool { - _, ok := o.GetPrefixLengthOk() - return ok -} - -// SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. -func (o *CreateNetworkIPv4Body) SetPrefixLength(v CreateNetworkIPv4BodyGetPrefixLengthRetType) { - setCreateNetworkIPv4BodyGetPrefixLengthAttributeType(&o.PrefixLength, v) -} - -func (o CreateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway); ok { - toSerialize["Gateway"] = val - } - if val, ok := getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { - toSerialize["Nameservers"] = val - } - if val, ok := getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(o.Prefix); ok { - toSerialize["Prefix"] = val - } - if val, ok := getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { - toSerialize["PrefixLength"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkIPv4Body struct { - value *CreateNetworkIPv4Body - isSet bool -} - -func (v NullableCreateNetworkIPv4Body) Get() *CreateNetworkIPv4Body { - return v.value -} - -func (v *NullableCreateNetworkIPv4Body) Set(val *CreateNetworkIPv4Body) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv4Body) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv4Body) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv4Body(val *CreateNetworkIPv4Body) *NullableCreateNetworkIPv4Body { - return &NullableCreateNetworkIPv4Body{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv4Body) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv4Body) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_ipv4_body_test.go b/services/iaasalpha/model_create_network_ipv4_body_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_ipv4_body_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_affinity_group_test.go b/services/iaasalpha/model_create_network_ipv4_test.go similarity index 89% rename from services/iaasalpha/model_affinity_group_test.go rename to services/iaasalpha/model_create_network_ipv4_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_affinity_group_test.go +++ b/services/iaasalpha/model_create_network_ipv4_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_create_network_ipv4_with_prefix.go b/services/iaasalpha/model_create_network_ipv4_with_prefix.go new file mode 100644 index 000000000..58704b15b --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv4_with_prefix.go @@ -0,0 +1,233 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} + +/* + types and functions for gateway +*/ + +// isModel +type CreateNetworkIPv4WithPrefixGetGatewayAttributeType = *NullableNetworkGatewayIPv4 +type CreateNetworkIPv4WithPrefixGetGatewayArgType = *NullableNetworkGatewayIPv4 +type CreateNetworkIPv4WithPrefixGetGatewayRetType = *NullableNetworkGatewayIPv4 + +func getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv4WithPrefixGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv4WithPrefixGetGatewayAttributeType, val CreateNetworkIPv4WithPrefixGetGatewayRetType) { + *arg = val +} + +/* + 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 { + 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 NetworkGatewayIPv4 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/iaasalpha/model_create_network_ipv4_with_prefix_length.go b/services/iaasalpha/model_create_network_ipv4_with_prefix_length.go new file mode 100644 index 000000000..99cdf8c39 --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_add_volume_to_server_payload_test.go b/services/iaasalpha/model_create_network_ipv4_with_prefix_length_test.go similarity index 89% rename from services/iaasalpha/model_add_volume_to_server_payload_test.go rename to services/iaasalpha/model_create_network_ipv4_with_prefix_length_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_add_volume_to_server_payload_test.go +++ b/services/iaasalpha/model_create_network_ipv4_with_prefix_length_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_create_network_ipv4_with_prefix_test.go b/services/iaasalpha/model_create_network_ipv4_with_prefix_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_create_network_ipv6.go b/services/iaasalpha/model_create_network_ipv6.go new file mode 100644 index 000000000..e07c50513 --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv6.go @@ -0,0 +1,145 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 + // try to unmarshal data into CreateNetworkIPv6WithPrefix + err = newStrictDecoder(data).Decode(&dst.CreateNetworkIPv6WithPrefix) + if err == nil { + jsonCreateNetworkIPv6WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefix) + if string(jsonCreateNetworkIPv6WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv6WithPrefixLength + err = newStrictDecoder(data).Decode(&dst.CreateNetworkIPv6WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv6WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefixLength) + if string(jsonCreateNetworkIPv6WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefixLength = nil + } + + 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/iaasalpha/model_create_network_ipv6_body.go b/services/iaasalpha/model_create_network_ipv6_body.go deleted file mode 100644 index 225d961af..000000000 --- a/services/iaasalpha/model_create_network_ipv6_body.go +++ /dev/null @@ -1,288 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNetworkIPv6Body type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv6Body{} - -/* - types and functions for gateway -*/ - -// isNullableString -type CreateNetworkIPv6BodyGetGatewayAttributeType = *NullableString - -func getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg CreateNetworkIPv6BodyGetGatewayAttributeType) (ret CreateNetworkIPv6BodyGetGatewayRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setCreateNetworkIPv6BodyGetGatewayAttributeType(arg *CreateNetworkIPv6BodyGetGatewayAttributeType, val CreateNetworkIPv6BodyGetGatewayRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type CreateNetworkIPv6BodyGetGatewayArgType = *string -type CreateNetworkIPv6BodyGetGatewayRetType = *string - -/* - types and functions for nameservers -*/ - -// isArray -type CreateNetworkIPv6BodyGetNameserversAttributeType = *[]string -type CreateNetworkIPv6BodyGetNameserversArgType = []string -type CreateNetworkIPv6BodyGetNameserversRetType = []string - -func getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(arg CreateNetworkIPv6BodyGetNameserversAttributeType) (ret CreateNetworkIPv6BodyGetNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv6BodyGetNameserversAttributeType(arg *CreateNetworkIPv6BodyGetNameserversAttributeType, val CreateNetworkIPv6BodyGetNameserversRetType) { - *arg = &val -} - -/* - types and functions for prefix -*/ - -// isNotNullableString -type CreateNetworkIPv6BodyGetPrefixAttributeType = *string - -func getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(arg CreateNetworkIPv6BodyGetPrefixAttributeType) (ret CreateNetworkIPv6BodyGetPrefixRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv6BodyGetPrefixAttributeType(arg *CreateNetworkIPv6BodyGetPrefixAttributeType, val CreateNetworkIPv6BodyGetPrefixRetType) { - *arg = &val -} - -type CreateNetworkIPv6BodyGetPrefixArgType = string -type CreateNetworkIPv6BodyGetPrefixRetType = string - -/* - types and functions for prefixLength -*/ - -// isInteger -type CreateNetworkIPv6BodyGetPrefixLengthAttributeType = *int64 -type CreateNetworkIPv6BodyGetPrefixLengthArgType = int64 -type CreateNetworkIPv6BodyGetPrefixLengthRetType = int64 - -func getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv6BodyGetPrefixLengthAttributeType) (ret CreateNetworkIPv6BodyGetPrefixLengthRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkIPv6BodyGetPrefixLengthAttributeType(arg *CreateNetworkIPv6BodyGetPrefixLengthAttributeType, val CreateNetworkIPv6BodyGetPrefixLengthRetType) { - *arg = &val -} - -// CreateNetworkIPv6Body The config object for an IPv6 network. -type CreateNetworkIPv6Body 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. - Gateway CreateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` - // A list containing DNS Servers/Nameservers for IPv6. - Nameservers CreateNetworkIPv6BodyGetNameserversAttributeType `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR) for IPv6. - Prefix CreateNetworkIPv6BodyGetPrefixAttributeType `json:"prefix,omitempty"` - PrefixLength CreateNetworkIPv6BodyGetPrefixLengthAttributeType `json:"prefixLength,omitempty"` -} - -// NewCreateNetworkIPv6Body instantiates a new CreateNetworkIPv6Body 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 NewCreateNetworkIPv6Body() *CreateNetworkIPv6Body { - this := CreateNetworkIPv6Body{} - return &this -} - -// NewCreateNetworkIPv6BodyWithDefaults instantiates a new CreateNetworkIPv6Body 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 NewCreateNetworkIPv6BodyWithDefaults() *CreateNetworkIPv6Body { - this := CreateNetworkIPv6Body{} - return &this -} - -// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateNetworkIPv6Body) GetGateway() (res CreateNetworkIPv6BodyGetGatewayRetType) { - 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 *CreateNetworkIPv6Body) GetGatewayOk() (ret CreateNetworkIPv6BodyGetGatewayRetType, ok bool) { - return getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway) -} - -// HasGateway returns a boolean if a field has been set. -func (o *CreateNetworkIPv6Body) HasGateway() bool { - _, ok := o.GetGatewayOk() - return ok -} - -// SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *CreateNetworkIPv6Body) SetGateway(v CreateNetworkIPv6BodyGetGatewayRetType) { - setCreateNetworkIPv6BodyGetGatewayAttributeType(&o.Gateway, v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *CreateNetworkIPv6Body) SetGatewayNil() { - o.Gateway = nil -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *CreateNetworkIPv6Body) UnsetGateway() { - o.Gateway = nil -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetNameservers() (res CreateNetworkIPv6BodyGetNameserversRetType) { - 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 *CreateNetworkIPv6Body) GetNameserversOk() (ret CreateNetworkIPv6BodyGetNameserversRetType, ok bool) { - return getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers) -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv6Body) HasNameservers() bool { - _, ok := o.GetNameserversOk() - return ok -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv6Body) SetNameservers(v CreateNetworkIPv6BodyGetNameserversRetType) { - setCreateNetworkIPv6BodyGetNameserversAttributeType(&o.Nameservers, v) -} - -// GetPrefix returns the Prefix field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetPrefix() (res CreateNetworkIPv6BodyGetPrefixRetType) { - res, _ = o.GetPrefixOk() - return -} - -// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6Body) GetPrefixOk() (ret CreateNetworkIPv6BodyGetPrefixRetType, ok bool) { - return getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(o.Prefix) -} - -// HasPrefix returns a boolean if a field has been set. -func (o *CreateNetworkIPv6Body) HasPrefix() bool { - _, ok := o.GetPrefixOk() - return ok -} - -// SetPrefix gets a reference to the given string and assigns it to the Prefix field. -func (o *CreateNetworkIPv6Body) SetPrefix(v CreateNetworkIPv6BodyGetPrefixRetType) { - setCreateNetworkIPv6BodyGetPrefixAttributeType(&o.Prefix, v) -} - -// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetPrefixLength() (res CreateNetworkIPv6BodyGetPrefixLengthRetType) { - res, _ = o.GetPrefixLengthOk() - return -} - -// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6Body) GetPrefixLengthOk() (ret CreateNetworkIPv6BodyGetPrefixLengthRetType, ok bool) { - return getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength) -} - -// HasPrefixLength returns a boolean if a field has been set. -func (o *CreateNetworkIPv6Body) HasPrefixLength() bool { - _, ok := o.GetPrefixLengthOk() - return ok -} - -// SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. -func (o *CreateNetworkIPv6Body) SetPrefixLength(v CreateNetworkIPv6BodyGetPrefixLengthRetType) { - setCreateNetworkIPv6BodyGetPrefixLengthAttributeType(&o.PrefixLength, v) -} - -func (o CreateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway); ok { - toSerialize["Gateway"] = val - } - if val, ok := getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { - toSerialize["Nameservers"] = val - } - if val, ok := getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(o.Prefix); ok { - toSerialize["Prefix"] = val - } - if val, ok := getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { - toSerialize["PrefixLength"] = val - } - return toSerialize, nil -} - -type NullableCreateNetworkIPv6Body struct { - value *CreateNetworkIPv6Body - isSet bool -} - -func (v NullableCreateNetworkIPv6Body) Get() *CreateNetworkIPv6Body { - return v.value -} - -func (v *NullableCreateNetworkIPv6Body) Set(val *CreateNetworkIPv6Body) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv6Body) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv6Body) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv6Body(val *CreateNetworkIPv6Body) *NullableCreateNetworkIPv6Body { - return &NullableCreateNetworkIPv6Body{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv6Body) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv6Body) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_network_ipv6_body_test.go b/services/iaasalpha/model_create_network_ipv6_body_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_network_ipv6_body_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_network_ipv6_test.go b/services/iaasalpha/model_create_network_ipv6_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_create_network_ipv6_with_prefix.go b/services/iaasalpha/model_create_network_ipv6_with_prefix.go new file mode 100644 index 000000000..ae9230a9d --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv6_with_prefix.go @@ -0,0 +1,233 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} + +/* + types and functions for gateway +*/ + +// isModel +type CreateNetworkIPv6WithPrefixGetGatewayAttributeType = *NullableNetworkGatewayIPv6 +type CreateNetworkIPv6WithPrefixGetGatewayArgType = *NullableNetworkGatewayIPv6 +type CreateNetworkIPv6WithPrefixGetGatewayRetType = *NullableNetworkGatewayIPv6 + +func getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv6WithPrefixGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv6WithPrefixGetGatewayAttributeType, val CreateNetworkIPv6WithPrefixGetGatewayRetType) { + *arg = val +} + +/* + 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 { + 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 NetworkGatewayIPv6 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/iaasalpha/model_create_network_ipv6_with_prefix_length.go b/services/iaasalpha/model_create_network_ipv6_with_prefix_length.go new file mode 100644 index 000000000..87b5b74ad --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_create_network_ipv6_with_prefix_length_test.go b/services/iaasalpha/model_create_network_ipv6_with_prefix_length_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_create_network_ipv6_with_prefix_test.go b/services/iaasalpha/model_create_network_ipv6_with_prefix_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_create_network_payload.go b/services/iaasalpha/model_create_network_payload.go index a875b7d9c..2b73435fa 100644 --- a/services/iaasalpha/model_create_network_payload.go +++ b/services/iaasalpha/model_create_network_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,22 +18,42 @@ import ( var _ MappedNullable = &CreateNetworkPayload{} /* - types and functions for addressFamily + 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 ipv6 +*/ + +// isModel +type CreateNetworkPayloadGetIpv6AttributeType = *CreateNetworkIPv6 +type CreateNetworkPayloadGetIpv6ArgType = CreateNetworkIPv6 +type CreateNetworkPayloadGetIpv6RetType = CreateNetworkIPv6 + +func getCreateNetworkPayloadGetIpv6AttributeTypeOk(arg CreateNetworkPayloadGetIpv6AttributeType) (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadGetIpv6AttributeType(arg *CreateNetworkPayloadGetIpv6AttributeType, val CreateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -98,9 +118,31 @@ 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"` + Ipv4 CreateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 CreateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Labels CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -108,6 +150,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 @@ -130,27 +174,50 @@ 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() +// 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 } -// GetAddressFamilyOk returns a tuple with the AddressFamily 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. -func (o *CreateNetworkPayload) GetAddressFamilyOk() (ret CreateNetworkPayloadGetAddressFamilyRetType, ok bool) { - return getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) +func (o *CreateNetworkPayload) GetIpv6Ok() (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { + return getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) } -// HasAddressFamily returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasAddressFamily() bool { - _, ok := o.GetAddressFamilyOk() +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv6() bool { + _, ok := o.GetIpv6Ok() 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) +// 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. @@ -216,10 +283,36 @@ 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 := 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 @@ -230,6 +323,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/iaasalpha/model_create_network_payload_test.go b/services/iaasalpha/model_create_network_payload_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_create_network_payload_test.go +++ b/services/iaasalpha/model_create_network_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_create_nic_payload.go b/services/iaasalpha/model_create_nic_payload.go deleted file mode 100644 index c6d2f7630..000000000 --- a/services/iaasalpha/model_create_nic_payload.go +++ /dev/null @@ -1,713 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateNicPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNicPayload{} - -/* - types and functions for allowedAddresses -*/ - -// isArray -type CreateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner -type CreateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner -type CreateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner - -func getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(arg CreateNicPayloadGetAllowedAddressesAttributeType) (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetAllowedAddressesAttributeType(arg *CreateNicPayloadGetAllowedAddressesAttributeType, val CreateNicPayloadGetAllowedAddressesRetType) { - *arg = &val -} - -/* - types and functions for device -*/ - -// isNotNullableString -type CreateNicPayloadGetDeviceAttributeType = *string - -func getCreateNicPayloadGetDeviceAttributeTypeOk(arg CreateNicPayloadGetDeviceAttributeType) (ret CreateNicPayloadGetDeviceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetDeviceAttributeType(arg *CreateNicPayloadGetDeviceAttributeType, val CreateNicPayloadGetDeviceRetType) { - *arg = &val -} - -type CreateNicPayloadGetDeviceArgType = string -type CreateNicPayloadGetDeviceRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateNicPayloadGetIdAttributeType = *string - -func getCreateNicPayloadGetIdAttributeTypeOk(arg CreateNicPayloadGetIdAttributeType) (ret CreateNicPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetIdAttributeType(arg *CreateNicPayloadGetIdAttributeType, val CreateNicPayloadGetIdRetType) { - *arg = &val -} - -type CreateNicPayloadGetIdArgType = string -type CreateNicPayloadGetIdRetType = string - -/* - types and functions for ipv4 -*/ - -// isNotNullableString -type CreateNicPayloadGetIpv4AttributeType = *string - -func getCreateNicPayloadGetIpv4AttributeTypeOk(arg CreateNicPayloadGetIpv4AttributeType) (ret CreateNicPayloadGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetIpv4AttributeType(arg *CreateNicPayloadGetIpv4AttributeType, val CreateNicPayloadGetIpv4RetType) { - *arg = &val -} - -type CreateNicPayloadGetIpv4ArgType = string -type CreateNicPayloadGetIpv4RetType = string - -/* - types and functions for ipv6 -*/ - -// isNotNullableString -type CreateNicPayloadGetIpv6AttributeType = *string - -func getCreateNicPayloadGetIpv6AttributeTypeOk(arg CreateNicPayloadGetIpv6AttributeType) (ret CreateNicPayloadGetIpv6RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetIpv6AttributeType(arg *CreateNicPayloadGetIpv6AttributeType, val CreateNicPayloadGetIpv6RetType) { - *arg = &val -} - -type CreateNicPayloadGetIpv6ArgType = string -type CreateNicPayloadGetIpv6RetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateNicPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateNicPayloadGetLabelsArgType = map[string]interface{} -type CreateNicPayloadGetLabelsRetType = map[string]interface{} - -func getCreateNicPayloadGetLabelsAttributeTypeOk(arg CreateNicPayloadGetLabelsAttributeType) (ret CreateNicPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetLabelsAttributeType(arg *CreateNicPayloadGetLabelsAttributeType, val CreateNicPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for mac -*/ - -// isNotNullableString -type CreateNicPayloadGetMacAttributeType = *string - -func getCreateNicPayloadGetMacAttributeTypeOk(arg CreateNicPayloadGetMacAttributeType) (ret CreateNicPayloadGetMacRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetMacAttributeType(arg *CreateNicPayloadGetMacAttributeType, val CreateNicPayloadGetMacRetType) { - *arg = &val -} - -type CreateNicPayloadGetMacArgType = string -type CreateNicPayloadGetMacRetType = string - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateNicPayloadGetNameAttributeType = *string - -func getCreateNicPayloadGetNameAttributeTypeOk(arg CreateNicPayloadGetNameAttributeType) (ret CreateNicPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetNameAttributeType(arg *CreateNicPayloadGetNameAttributeType, val CreateNicPayloadGetNameRetType) { - *arg = &val -} - -type CreateNicPayloadGetNameArgType = string -type CreateNicPayloadGetNameRetType = string - -/* - types and functions for networkId -*/ - -// isNotNullableString -type CreateNicPayloadGetNetworkIdAttributeType = *string - -func getCreateNicPayloadGetNetworkIdAttributeTypeOk(arg CreateNicPayloadGetNetworkIdAttributeType) (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetNetworkIdAttributeType(arg *CreateNicPayloadGetNetworkIdAttributeType, val CreateNicPayloadGetNetworkIdRetType) { - *arg = &val -} - -type CreateNicPayloadGetNetworkIdArgType = string -type CreateNicPayloadGetNetworkIdRetType = string - -/* - types and functions for nicSecurity -*/ - -// isBoolean -type CreateNicPayloadgetNicSecurityAttributeType = *bool -type CreateNicPayloadgetNicSecurityArgType = bool -type CreateNicPayloadgetNicSecurityRetType = bool - -func getCreateNicPayloadgetNicSecurityAttributeTypeOk(arg CreateNicPayloadgetNicSecurityAttributeType) (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadgetNicSecurityAttributeType(arg *CreateNicPayloadgetNicSecurityAttributeType, val CreateNicPayloadgetNicSecurityRetType) { - *arg = &val -} - -/* - types and functions for securityGroups -*/ - -// isArray -type CreateNicPayloadGetSecurityGroupsAttributeType = *[]string -type CreateNicPayloadGetSecurityGroupsArgType = []string -type CreateNicPayloadGetSecurityGroupsRetType = []string - -func getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(arg CreateNicPayloadGetSecurityGroupsAttributeType) (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetSecurityGroupsAttributeType(arg *CreateNicPayloadGetSecurityGroupsAttributeType, val CreateNicPayloadGetSecurityGroupsRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateNicPayloadGetStatusAttributeType = *string - -func getCreateNicPayloadGetStatusAttributeTypeOk(arg CreateNicPayloadGetStatusAttributeType) (ret CreateNicPayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetStatusAttributeType(arg *CreateNicPayloadGetStatusAttributeType, val CreateNicPayloadGetStatusRetType) { - *arg = &val -} - -type CreateNicPayloadGetStatusArgType = string -type CreateNicPayloadGetStatusRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type CreateNicPayloadGetTypeAttributeType = *string - -func getCreateNicPayloadGetTypeAttributeTypeOk(arg CreateNicPayloadGetTypeAttributeType) (ret CreateNicPayloadGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNicPayloadGetTypeAttributeType(arg *CreateNicPayloadGetTypeAttributeType, val CreateNicPayloadGetTypeRetType) { - *arg = &val -} - -type CreateNicPayloadGetTypeArgType = string -type CreateNicPayloadGetTypeRetType = string - -// CreateNicPayload Object that represents a network interface. -type CreateNicPayload struct { - // A list of IPs or CIDR notations. - AllowedAddresses CreateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` - // Universally Unique Identifier (UUID). - Device CreateNicPayloadGetDeviceAttributeType `json:"device,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateNicPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ipv4 CreateNicPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` - // String that represents an IPv6 address. - Ipv6 CreateNicPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Object that represents an MAC address. - Mac CreateNicPayloadGetMacAttributeType `json:"mac,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name CreateNicPayloadGetNameAttributeType `json:"name,omitempty"` - // Universally Unique Identifier (UUID). - NetworkId CreateNicPayloadGetNetworkIdAttributeType `json:"networkId,omitempty"` - // If this is set to false, then no security groups will apply to this network interface. - NicSecurity CreateNicPayloadgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` - // A list of UUIDs. - SecurityGroups CreateNicPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` - Status CreateNicPayloadGetStatusAttributeType `json:"status,omitempty"` - Type CreateNicPayloadGetTypeAttributeType `json:"type,omitempty"` -} - -// NewCreateNicPayload instantiates a new CreateNicPayload 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 NewCreateNicPayload() *CreateNicPayload { - this := CreateNicPayload{} - return &this -} - -// NewCreateNicPayloadWithDefaults instantiates a new CreateNicPayload 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 NewCreateNicPayloadWithDefaults() *CreateNicPayload { - this := CreateNicPayload{} - var nicSecurity bool = true - this.NicSecurity = &nicSecurity - return &this -} - -// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *CreateNicPayload) GetAllowedAddresses() (res CreateNicPayloadGetAllowedAddressesRetType) { - res, _ = o.GetAllowedAddressesOk() - return -} - -// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetAllowedAddressesOk() (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { - return getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) -} - -// HasAllowedAddresses returns a boolean if a field has been set. -func (o *CreateNicPayload) HasAllowedAddresses() bool { - _, ok := o.GetAllowedAddressesOk() - return ok -} - -// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *CreateNicPayload) SetAllowedAddresses(v CreateNicPayloadGetAllowedAddressesRetType) { - setCreateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) -} - -// GetDevice returns the Device field value if set, zero value otherwise. -func (o *CreateNicPayload) GetDevice() (res CreateNicPayloadGetDeviceRetType) { - res, _ = o.GetDeviceOk() - return -} - -// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetDeviceOk() (ret CreateNicPayloadGetDeviceRetType, ok bool) { - return getCreateNicPayloadGetDeviceAttributeTypeOk(o.Device) -} - -// HasDevice returns a boolean if a field has been set. -func (o *CreateNicPayload) HasDevice() bool { - _, ok := o.GetDeviceOk() - return ok -} - -// SetDevice gets a reference to the given string and assigns it to the Device field. -func (o *CreateNicPayload) SetDevice(v CreateNicPayloadGetDeviceRetType) { - setCreateNicPayloadGetDeviceAttributeType(&o.Device, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateNicPayload) GetId() (res CreateNicPayloadGetIdRetType) { - 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 *CreateNicPayload) GetIdOk() (ret CreateNicPayloadGetIdRetType, ok bool) { - return getCreateNicPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateNicPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateNicPayload) SetId(v CreateNicPayloadGetIdRetType) { - setCreateNicPayloadGetIdAttributeType(&o.Id, v) -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNicPayload) GetIpv4() (res CreateNicPayloadGetIpv4RetType) { - 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 *CreateNicPayload) GetIpv4Ok() (ret CreateNicPayloadGetIpv4RetType, ok bool) { - return getCreateNicPayloadGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateNicPayload) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *CreateNicPayload) SetIpv4(v CreateNicPayloadGetIpv4RetType) { - setCreateNicPayloadGetIpv4AttributeType(&o.Ipv4, v) -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *CreateNicPayload) GetIpv6() (res CreateNicPayloadGetIpv6RetType) { - 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 *CreateNicPayload) GetIpv6Ok() (ret CreateNicPayloadGetIpv6RetType, ok bool) { - return getCreateNicPayloadGetIpv6AttributeTypeOk(o.Ipv6) -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *CreateNicPayload) HasIpv6() bool { - _, ok := o.GetIpv6Ok() - return ok -} - -// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *CreateNicPayload) SetIpv6(v CreateNicPayloadGetIpv6RetType) { - setCreateNicPayloadGetIpv6AttributeType(&o.Ipv6, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateNicPayload) GetLabels() (res CreateNicPayloadGetLabelsRetType) { - 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 *CreateNicPayload) GetLabelsOk() (ret CreateNicPayloadGetLabelsRetType, ok bool) { - return getCreateNicPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateNicPayload) 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 *CreateNicPayload) SetLabels(v CreateNicPayloadGetLabelsRetType) { - setCreateNicPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMac returns the Mac field value if set, zero value otherwise. -func (o *CreateNicPayload) GetMac() (res CreateNicPayloadGetMacRetType) { - res, _ = o.GetMacOk() - return -} - -// GetMacOk returns a tuple with the Mac field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetMacOk() (ret CreateNicPayloadGetMacRetType, ok bool) { - return getCreateNicPayloadGetMacAttributeTypeOk(o.Mac) -} - -// HasMac returns a boolean if a field has been set. -func (o *CreateNicPayload) HasMac() bool { - _, ok := o.GetMacOk() - return ok -} - -// SetMac gets a reference to the given string and assigns it to the Mac field. -func (o *CreateNicPayload) SetMac(v CreateNicPayloadGetMacRetType) { - setCreateNicPayloadGetMacAttributeType(&o.Mac, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateNicPayload) GetName() (res CreateNicPayloadGetNameRetType) { - 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 *CreateNicPayload) GetNameOk() (ret CreateNicPayloadGetNameRetType, ok bool) { - return getCreateNicPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateNicPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateNicPayload) SetName(v CreateNicPayloadGetNameRetType) { - setCreateNicPayloadGetNameAttributeType(&o.Name, v) -} - -// GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *CreateNicPayload) GetNetworkId() (res CreateNicPayloadGetNetworkIdRetType) { - res, _ = o.GetNetworkIdOk() - return -} - -// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetNetworkIdOk() (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { - return getCreateNicPayloadGetNetworkIdAttributeTypeOk(o.NetworkId) -} - -// HasNetworkId returns a boolean if a field has been set. -func (o *CreateNicPayload) HasNetworkId() bool { - _, ok := o.GetNetworkIdOk() - return ok -} - -// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *CreateNicPayload) SetNetworkId(v CreateNicPayloadGetNetworkIdRetType) { - setCreateNicPayloadGetNetworkIdAttributeType(&o.NetworkId, v) -} - -// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *CreateNicPayload) GetNicSecurity() (res CreateNicPayloadgetNicSecurityRetType) { - res, _ = o.GetNicSecurityOk() - return -} - -// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetNicSecurityOk() (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { - return getCreateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) -} - -// HasNicSecurity returns a boolean if a field has been set. -func (o *CreateNicPayload) HasNicSecurity() bool { - _, ok := o.GetNicSecurityOk() - return ok -} - -// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *CreateNicPayload) SetNicSecurity(v CreateNicPayloadgetNicSecurityRetType) { - setCreateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *CreateNicPayload) GetSecurityGroups() (res CreateNicPayloadGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetSecurityGroupsOk() (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { - return getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *CreateNicPayload) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *CreateNicPayload) SetSecurityGroups(v CreateNicPayloadGetSecurityGroupsRetType) { - setCreateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateNicPayload) GetStatus() (res CreateNicPayloadGetStatusRetType) { - 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 *CreateNicPayload) GetStatusOk() (ret CreateNicPayloadGetStatusRetType, ok bool) { - return getCreateNicPayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateNicPayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateNicPayload) SetStatus(v CreateNicPayloadGetStatusRetType) { - setCreateNicPayloadGetStatusAttributeType(&o.Status, v) -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *CreateNicPayload) GetType() (res CreateNicPayloadGetTypeRetType) { - res, _ = o.GetTypeOk() - return -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetTypeOk() (ret CreateNicPayloadGetTypeRetType, ok bool) { - return getCreateNicPayloadGetTypeAttributeTypeOk(o.Type) -} - -// HasType returns a boolean if a field has been set. -func (o *CreateNicPayload) HasType() bool { - _, ok := o.GetTypeOk() - return ok -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *CreateNicPayload) SetType(v CreateNicPayloadGetTypeRetType) { - setCreateNicPayloadGetTypeAttributeType(&o.Type, v) -} - -func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { - toSerialize["AllowedAddresses"] = val - } - if val, ok := getCreateNicPayloadGetDeviceAttributeTypeOk(o.Device); ok { - toSerialize["Device"] = val - } - if val, ok := getCreateNicPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateNicPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - if val, ok := getCreateNicPayloadGetIpv6AttributeTypeOk(o.Ipv6); ok { - toSerialize["Ipv6"] = val - } - if val, ok := getCreateNicPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateNicPayloadGetMacAttributeTypeOk(o.Mac); ok { - toSerialize["Mac"] = val - } - if val, ok := getCreateNicPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateNicPayloadGetNetworkIdAttributeTypeOk(o.NetworkId); ok { - toSerialize["NetworkId"] = val - } - if val, ok := getCreateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { - toSerialize["NicSecurity"] = val - } - if val, ok := getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - if val, ok := getCreateNicPayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getCreateNicPayloadGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableCreateNicPayload struct { - value *CreateNicPayload - isSet bool -} - -func (v NullableCreateNicPayload) Get() *CreateNicPayload { - return v.value -} - -func (v *NullableCreateNicPayload) Set(val *CreateNicPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNicPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNicPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNicPayload(val *CreateNicPayload) *NullableCreateNicPayload { - return &NullableCreateNicPayload{value: val, isSet: true} -} - -func (v NullableCreateNicPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNicPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_nic_payload_test.go b/services/iaasalpha/model_create_nic_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_nic_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_protocol.go b/services/iaasalpha/model_create_protocol.go deleted file mode 100644 index 088a6e00c..000000000 --- a/services/iaasalpha/model_create_protocol.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "fmt" -) - -// CreateProtocol - The schema for a protocol when creating a security group rule. -type CreateProtocol struct { - Int64 *int64 - String *string -} - -// int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol -func Int64AsCreateProtocol(v *int64) CreateProtocol { - return CreateProtocol{ - Int64: v, - } -} - -// stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol -func StringAsCreateProtocol(v *string) CreateProtocol { - return CreateProtocol{ - String: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into Int64 - err = newStrictDecoder(data).Decode(&dst.Int64) - if err == nil { - jsonInt64, _ := json.Marshal(dst.Int64) - if string(jsonInt64) == "{}" { // empty struct - dst.Int64 = nil - } else { - match++ - } - } else { - dst.Int64 = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - match++ - } - } else { - dst.String = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.Int64 = nil - dst.String = nil - - return fmt.Errorf("data matches more than one schema in oneOf(CreateProtocol)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(CreateProtocol)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateProtocol) MarshalJSON() ([]byte, error) { - if src.Int64 != nil { - return json.Marshal(&src.Int64) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return []byte("{}"), nil // no data in oneOf schemas => empty JSON object -} - -// Get the actual instance -func (obj *CreateProtocol) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.Int64 != nil { - return obj.Int64 - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -type NullableCreateProtocol struct { - value *CreateProtocol - isSet bool -} - -func (v NullableCreateProtocol) Get() *CreateProtocol { - return v.value -} - -func (v *NullableCreateProtocol) Set(val *CreateProtocol) { - v.value = val - v.isSet = true -} - -func (v NullableCreateProtocol) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateProtocol) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { - return &NullableCreateProtocol{value: val, isSet: true} -} - -func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_protocol_test.go b/services/iaasalpha/model_create_protocol_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_protocol_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_public_ip_payload.go b/services/iaasalpha/model_create_public_ip_payload.go deleted file mode 100644 index c8031f1ba..000000000 --- a/services/iaasalpha/model_create_public_ip_payload.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreatePublicIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreatePublicIPPayload{} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreatePublicIPPayloadGetIdAttributeType = *string - -func getCreatePublicIPPayloadGetIdAttributeTypeOk(arg CreatePublicIPPayloadGetIdAttributeType) (ret CreatePublicIPPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreatePublicIPPayloadGetIdAttributeType(arg *CreatePublicIPPayloadGetIdAttributeType, val CreatePublicIPPayloadGetIdRetType) { - *arg = &val -} - -type CreatePublicIPPayloadGetIdArgType = string -type CreatePublicIPPayloadGetIdRetType = string - -/* - types and functions for ip -*/ - -// isNotNullableString -type CreatePublicIPPayloadGetIpAttributeType = *string - -func getCreatePublicIPPayloadGetIpAttributeTypeOk(arg CreatePublicIPPayloadGetIpAttributeType) (ret CreatePublicIPPayloadGetIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreatePublicIPPayloadGetIpAttributeType(arg *CreatePublicIPPayloadGetIpAttributeType, val CreatePublicIPPayloadGetIpRetType) { - *arg = &val -} - -type CreatePublicIPPayloadGetIpArgType = string -type CreatePublicIPPayloadGetIpRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} -type CreatePublicIPPayloadGetLabelsArgType = map[string]interface{} -type CreatePublicIPPayloadGetLabelsRetType = map[string]interface{} - -func getCreatePublicIPPayloadGetLabelsAttributeTypeOk(arg CreatePublicIPPayloadGetLabelsAttributeType) (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreatePublicIPPayloadGetLabelsAttributeType(arg *CreatePublicIPPayloadGetLabelsAttributeType, val CreatePublicIPPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for networkInterface -*/ - -// isNullableString -type CreatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString - -func getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg CreatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *CreatePublicIPPayloadGetNetworkInterfaceAttributeType, val CreatePublicIPPayloadGetNetworkInterfaceRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type CreatePublicIPPayloadGetNetworkInterfaceArgType = *string -type CreatePublicIPPayloadGetNetworkInterfaceRetType = *string - -// CreatePublicIPPayload Object that represents a public IP. -type CreatePublicIPPayload struct { - // Universally Unique Identifier (UUID). - Id CreatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ip CreatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Universally Unique Identifier (UUID). - NetworkInterface CreatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` -} - -// NewCreatePublicIPPayload instantiates a new CreatePublicIPPayload 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 NewCreatePublicIPPayload() *CreatePublicIPPayload { - this := CreatePublicIPPayload{} - return &this -} - -// NewCreatePublicIPPayloadWithDefaults instantiates a new CreatePublicIPPayload 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 NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { - this := CreatePublicIPPayload{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetId() (res CreatePublicIPPayloadGetIdRetType) { - 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 *CreatePublicIPPayload) GetIdOk() (ret CreatePublicIPPayloadGetIdRetType, ok bool) { - return getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreatePublicIPPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreatePublicIPPayload) SetId(v CreatePublicIPPayloadGetIdRetType) { - setCreatePublicIPPayloadGetIdAttributeType(&o.Id, v) -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetIp() (res CreatePublicIPPayloadGetIpRetType) { - res, _ = o.GetIpOk() - return -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePublicIPPayload) GetIpOk() (ret CreatePublicIPPayloadGetIpRetType, ok bool) { - return getCreatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) -} - -// HasIp returns a boolean if a field has been set. -func (o *CreatePublicIPPayload) HasIp() bool { - _, ok := o.GetIpOk() - return ok -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *CreatePublicIPPayload) SetIp(v CreatePublicIPPayloadGetIpRetType) { - setCreatePublicIPPayloadGetIpAttributeType(&o.Ip, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetLabels() (res CreatePublicIPPayloadGetLabelsRetType) { - 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 *CreatePublicIPPayload) GetLabelsOk() (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { - return getCreatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreatePublicIPPayload) 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 *CreatePublicIPPayload) SetLabels(v CreatePublicIPPayloadGetLabelsRetType) { - setCreatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreatePublicIPPayload) GetNetworkInterface() (res CreatePublicIPPayloadGetNetworkInterfaceRetType) { - res, _ = o.GetNetworkInterfaceOk() - return -} - -// GetNetworkInterfaceOk returns a tuple with the NetworkInterface 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 *CreatePublicIPPayload) GetNetworkInterfaceOk() (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { - return getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) -} - -// HasNetworkInterface returns a boolean if a field has been set. -func (o *CreatePublicIPPayload) HasNetworkInterface() bool { - _, ok := o.GetNetworkInterfaceOk() - return ok -} - -// SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *CreatePublicIPPayload) SetNetworkInterface(v CreatePublicIPPayloadGetNetworkInterfaceRetType) { - setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) -} - -// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil -func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { - o.NetworkInterface = nil -} - -// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil -func (o *CreatePublicIPPayload) UnsetNetworkInterface() { - o.NetworkInterface = nil -} - -func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreatePublicIPPayloadGetIpAttributeTypeOk(o.Ip); ok { - toSerialize["Ip"] = val - } - if val, ok := getCreatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { - toSerialize["NetworkInterface"] = val - } - return toSerialize, nil -} - -type NullableCreatePublicIPPayload struct { - value *CreatePublicIPPayload - isSet bool -} - -func (v NullableCreatePublicIPPayload) Get() *CreatePublicIPPayload { - return v.value -} - -func (v *NullableCreatePublicIPPayload) Set(val *CreatePublicIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePublicIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePublicIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePublicIPPayload(val *CreatePublicIPPayload) *NullableCreatePublicIPPayload { - return &NullableCreatePublicIPPayload{value: val, isSet: true} -} - -func (v NullableCreatePublicIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePublicIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_public_ip_payload_test.go b/services/iaasalpha/model_create_public_ip_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_public_ip_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_security_group_payload.go b/services/iaasalpha/model_create_security_group_payload.go deleted file mode 100644 index 19ee5982b..000000000 --- a/services/iaasalpha/model_create_security_group_payload.go +++ /dev/null @@ -1,468 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateSecurityGroupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateSecurityGroupPayload{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateSecurityGroupPayloadGetCreatedAtAttributeType = *time.Time -type CreateSecurityGroupPayloadGetCreatedAtArgType = time.Time -type CreateSecurityGroupPayloadGetCreatedAtRetType = time.Time - -func getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetCreatedAtAttributeType) (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetCreatedAtAttributeType(arg *CreateSecurityGroupPayloadGetCreatedAtAttributeType, val CreateSecurityGroupPayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -type CreateSecurityGroupPayloadGetDescriptionAttributeType = *string - -func getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupPayloadGetDescriptionAttributeType) (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetDescriptionAttributeType(arg *CreateSecurityGroupPayloadGetDescriptionAttributeType, val CreateSecurityGroupPayloadGetDescriptionRetType) { - *arg = &val -} - -type CreateSecurityGroupPayloadGetDescriptionArgType = string -type CreateSecurityGroupPayloadGetDescriptionRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateSecurityGroupPayloadGetIdAttributeType = *string - -func getCreateSecurityGroupPayloadGetIdAttributeTypeOk(arg CreateSecurityGroupPayloadGetIdAttributeType) (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetIdAttributeType(arg *CreateSecurityGroupPayloadGetIdAttributeType, val CreateSecurityGroupPayloadGetIdRetType) { - *arg = &val -} - -type CreateSecurityGroupPayloadGetIdArgType = string -type CreateSecurityGroupPayloadGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} -type CreateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} - -func getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg CreateSecurityGroupPayloadGetLabelsAttributeType) (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetLabelsAttributeType(arg *CreateSecurityGroupPayloadGetLabelsAttributeType, val CreateSecurityGroupPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateSecurityGroupPayloadGetNameAttributeType = *string - -func getCreateSecurityGroupPayloadGetNameAttributeTypeOk(arg CreateSecurityGroupPayloadGetNameAttributeType) (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetNameAttributeType(arg *CreateSecurityGroupPayloadGetNameAttributeType, val CreateSecurityGroupPayloadGetNameRetType) { - *arg = &val -} - -type CreateSecurityGroupPayloadGetNameArgType = string -type CreateSecurityGroupPayloadGetNameRetType = string - -/* - types and functions for rules -*/ - -// isArray -type CreateSecurityGroupPayloadGetRulesAttributeType = *[]SecurityGroupRule -type CreateSecurityGroupPayloadGetRulesArgType = []SecurityGroupRule -type CreateSecurityGroupPayloadGetRulesRetType = []SecurityGroupRule - -func getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(arg CreateSecurityGroupPayloadGetRulesAttributeType) (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetRulesAttributeType(arg *CreateSecurityGroupPayloadGetRulesAttributeType, val CreateSecurityGroupPayloadGetRulesRetType) { - *arg = &val -} - -/* - types and functions for stateful -*/ - -// isBoolean -type CreateSecurityGroupPayloadgetStatefulAttributeType = *bool -type CreateSecurityGroupPayloadgetStatefulArgType = bool -type CreateSecurityGroupPayloadgetStatefulRetType = bool - -func getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(arg CreateSecurityGroupPayloadgetStatefulAttributeType) (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadgetStatefulAttributeType(arg *CreateSecurityGroupPayloadgetStatefulAttributeType, val CreateSecurityGroupPayloadgetStatefulRetType) { - *arg = &val -} - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateSecurityGroupPayloadGetUpdatedAtAttributeType = *time.Time -type CreateSecurityGroupPayloadGetUpdatedAtArgType = time.Time -type CreateSecurityGroupPayloadGetUpdatedAtRetType = time.Time - -func getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetUpdatedAtAttributeType) (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(arg *CreateSecurityGroupPayloadGetUpdatedAtAttributeType, val CreateSecurityGroupPayloadGetUpdatedAtRetType) { - *arg = &val -} - -// CreateSecurityGroupPayload Object that represents a security group. -type CreateSecurityGroupPayload struct { - // Date-time when resource was created. - CreatedAt CreateSecurityGroupPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description CreateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateSecurityGroupPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name CreateSecurityGroupPayloadGetNameAttributeType `json:"name" required:"true"` - // A list containing security group rule objects. - Rules CreateSecurityGroupPayloadGetRulesAttributeType `json:"rules,omitempty"` - // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. - Stateful CreateSecurityGroupPayloadgetStatefulAttributeType `json:"stateful,omitempty"` - // Date-time when resource was last updated. - UpdatedAt CreateSecurityGroupPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _CreateSecurityGroupPayload CreateSecurityGroupPayload - -// NewCreateSecurityGroupPayload instantiates a new CreateSecurityGroupPayload 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 NewCreateSecurityGroupPayload(name CreateSecurityGroupPayloadGetNameArgType) *CreateSecurityGroupPayload { - this := CreateSecurityGroupPayload{} - setCreateSecurityGroupPayloadGetNameAttributeType(&this.Name, name) - return &this -} - -// NewCreateSecurityGroupPayloadWithDefaults instantiates a new CreateSecurityGroupPayload 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 NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { - this := CreateSecurityGroupPayload{} - var stateful bool = true - this.Stateful = &stateful - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetCreatedAt() (res CreateSecurityGroupPayloadGetCreatedAtRetType) { - 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 *CreateSecurityGroupPayload) GetCreatedAtOk() (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { - return getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetCreatedAt(v CreateSecurityGroupPayloadGetCreatedAtRetType) { - setCreateSecurityGroupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetDescription() (res CreateSecurityGroupPayloadGetDescriptionRetType) { - 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 *CreateSecurityGroupPayload) GetDescriptionOk() (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { - return getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreateSecurityGroupPayload) SetDescription(v CreateSecurityGroupPayloadGetDescriptionRetType) { - setCreateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetId() (res CreateSecurityGroupPayloadGetIdRetType) { - 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 *CreateSecurityGroupPayload) GetIdOk() (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { - return getCreateSecurityGroupPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateSecurityGroupPayload) SetId(v CreateSecurityGroupPayloadGetIdRetType) { - setCreateSecurityGroupPayloadGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetLabels() (res CreateSecurityGroupPayloadGetLabelsRetType) { - 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 *CreateSecurityGroupPayload) GetLabelsOk() (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { - return getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetLabels(v CreateSecurityGroupPayloadGetLabelsRetType) { - setCreateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value -func (o *CreateSecurityGroupPayload) GetName() (ret CreateSecurityGroupPayloadGetNameRetType) { - 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 *CreateSecurityGroupPayload) GetNameOk() (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { - return getCreateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *CreateSecurityGroupPayload) SetName(v CreateSecurityGroupPayloadGetNameRetType) { - setCreateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetRules() (res CreateSecurityGroupPayloadGetRulesRetType) { - res, _ = o.GetRulesOk() - return -} - -// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetRulesOk() (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { - return getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(o.Rules) -} - -// HasRules returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) HasRules() bool { - _, ok := o.GetRulesOk() - return ok -} - -// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. -func (o *CreateSecurityGroupPayload) SetRules(v CreateSecurityGroupPayloadGetRulesRetType) { - setCreateSecurityGroupPayloadGetRulesAttributeType(&o.Rules, v) -} - -// GetStateful returns the Stateful field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetStateful() (res CreateSecurityGroupPayloadgetStatefulRetType) { - res, _ = o.GetStatefulOk() - return -} - -// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetStatefulOk() (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { - return getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(o.Stateful) -} - -// HasStateful returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) HasStateful() bool { - _, ok := o.GetStatefulOk() - return ok -} - -// SetStateful gets a reference to the given bool and assigns it to the Stateful field. -func (o *CreateSecurityGroupPayload) SetStateful(v CreateSecurityGroupPayloadgetStatefulRetType) { - setCreateSecurityGroupPayloadgetStatefulAttributeType(&o.Stateful, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetUpdatedAt() (res CreateSecurityGroupPayloadGetUpdatedAtRetType) { - 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 *CreateSecurityGroupPayload) GetUpdatedAtOk() (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { - return getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetUpdatedAt(v CreateSecurityGroupPayloadGetUpdatedAtRetType) { - setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(o.Rules); ok { - toSerialize["Rules"] = val - } - if val, ok := getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(o.Stateful); ok { - toSerialize["Stateful"] = val - } - if val, ok := getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableCreateSecurityGroupPayload struct { - value *CreateSecurityGroupPayload - isSet bool -} - -func (v NullableCreateSecurityGroupPayload) Get() *CreateSecurityGroupPayload { - return v.value -} - -func (v *NullableCreateSecurityGroupPayload) Set(val *CreateSecurityGroupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSecurityGroupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSecurityGroupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSecurityGroupPayload(val *CreateSecurityGroupPayload) *NullableCreateSecurityGroupPayload { - return &NullableCreateSecurityGroupPayload{value: val, isSet: true} -} - -func (v NullableCreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSecurityGroupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_security_group_payload_test.go b/services/iaasalpha/model_create_security_group_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_security_group_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_security_group_rule_payload.go b/services/iaasalpha/model_create_security_group_rule_payload.go deleted file mode 100644 index e34fbc323..000000000 --- a/services/iaasalpha/model_create_security_group_rule_payload.go +++ /dev/null @@ -1,564 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateSecurityGroupRulePayload{} - -/* - types and functions for description -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetDescriptionAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDescriptionAttributeType) (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(arg *CreateSecurityGroupRulePayloadGetDescriptionAttributeType, val CreateSecurityGroupRulePayloadGetDescriptionRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetDescriptionArgType = string -type CreateSecurityGroupRulePayloadGetDescriptionRetType = string - -/* - types and functions for direction -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetDirectionAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDirectionAttributeType) (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetDirectionAttributeType(arg *CreateSecurityGroupRulePayloadGetDirectionAttributeType, val CreateSecurityGroupRulePayloadGetDirectionRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetDirectionArgType = string -type CreateSecurityGroupRulePayloadGetDirectionRetType = string - -/* - types and functions for ethertype -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetEthertypeAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetEthertypeAttributeType) (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(arg *CreateSecurityGroupRulePayloadGetEthertypeAttributeType, val CreateSecurityGroupRulePayloadGetEthertypeRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetEthertypeArgType = string -type CreateSecurityGroupRulePayloadGetEthertypeRetType = string - -/* - types and functions for icmpParameters -*/ - -// isModel -type CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType = *ICMPParameters -type CreateSecurityGroupRulePayloadGetIcmpParametersArgType = ICMPParameters -type CreateSecurityGroupRulePayloadGetIcmpParametersRetType = ICMPParameters - -func getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType) (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(arg *CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType, val CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetIdAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIdAttributeType) (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetIdAttributeType(arg *CreateSecurityGroupRulePayloadGetIdAttributeType, val CreateSecurityGroupRulePayloadGetIdRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetIdArgType = string -type CreateSecurityGroupRulePayloadGetIdRetType = string - -/* - types and functions for ipRange -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetIpRangeAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIpRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetIpRangeAttributeType, val CreateSecurityGroupRulePayloadGetIpRangeRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetIpRangeArgType = string -type CreateSecurityGroupRulePayloadGetIpRangeRetType = string - -/* - types and functions for portRange -*/ - -// isModel -type CreateSecurityGroupRulePayloadGetPortRangeAttributeType = *PortRange -type CreateSecurityGroupRulePayloadGetPortRangeArgType = PortRange -type CreateSecurityGroupRulePayloadGetPortRangeRetType = PortRange - -func getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetPortRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetPortRangeAttributeType, val CreateSecurityGroupRulePayloadGetPortRangeRetType) { - *arg = &val -} - -/* - types and functions for remoteSecurityGroupId -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdArgType = string -type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType = string - -/* - types and functions for securityGroupId -*/ - -// isNotNullableString -type CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType = *string - -func getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { - *arg = &val -} - -type CreateSecurityGroupRulePayloadGetSecurityGroupIdArgType = string -type CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType = string - -/* - types and functions for protocol -*/ - -// isModel -type CreateSecurityGroupRulePayloadGetProtocolAttributeType = *CreateProtocol -type CreateSecurityGroupRulePayloadGetProtocolArgType = CreateProtocol -type CreateSecurityGroupRulePayloadGetProtocolRetType = CreateProtocol - -func getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetProtocolAttributeType) (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRulePayloadGetProtocolAttributeType(arg *CreateSecurityGroupRulePayloadGetProtocolAttributeType, val CreateSecurityGroupRulePayloadGetProtocolRetType) { - *arg = &val -} - -// CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. -type CreateSecurityGroupRulePayload struct { - // Description Object. Allows string up to 255 Characters. - Description CreateSecurityGroupRulePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The direction of the traffic which the rule should match. - // REQUIRED - Direction CreateSecurityGroupRulePayloadGetDirectionAttributeType `json:"direction" required:"true"` - // The ethertype which the rule should match. - Ethertype CreateSecurityGroupRulePayloadGetEthertypeAttributeType `json:"ethertype,omitempty"` - IcmpParameters CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateSecurityGroupRulePayloadGetIdAttributeType `json:"id,omitempty"` - // Classless Inter-Domain Routing (CIDR). - IpRange CreateSecurityGroupRulePayloadGetIpRangeAttributeType `json:"ipRange,omitempty"` - PortRange CreateSecurityGroupRulePayloadGetPortRangeAttributeType `json:"portRange,omitempty"` - // Universally Unique Identifier (UUID). - RemoteSecurityGroupId CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` - // Universally Unique Identifier (UUID). - SecurityGroupId CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` - Protocol CreateSecurityGroupRulePayloadGetProtocolAttributeType `json:"protocol,omitempty"` -} - -type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload - -// NewCreateSecurityGroupRulePayload instantiates a new CreateSecurityGroupRulePayload 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 NewCreateSecurityGroupRulePayload(direction CreateSecurityGroupRulePayloadGetDirectionArgType) *CreateSecurityGroupRulePayload { - this := CreateSecurityGroupRulePayload{} - setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&this.Direction, direction) - return &this -} - -// NewCreateSecurityGroupRulePayloadWithDefaults instantiates a new CreateSecurityGroupRulePayload 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 NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePayload { - this := CreateSecurityGroupRulePayload{} - var ethertype string = "IPv4" - this.Ethertype = ðertype - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetDescription() (res CreateSecurityGroupRulePayloadGetDescriptionRetType) { - 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 *CreateSecurityGroupRulePayload) GetDescriptionOk() (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreateSecurityGroupRulePayload) SetDescription(v CreateSecurityGroupRulePayloadGetDescriptionRetType) { - setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetDirection returns the Direction field value -func (o *CreateSecurityGroupRulePayload) GetDirection() (ret CreateSecurityGroupRulePayloadGetDirectionRetType) { - ret, _ = o.GetDirectionOk() - return ret -} - -// GetDirectionOk returns a tuple with the Direction field value -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(o.Direction) -} - -// SetDirection sets field value -func (o *CreateSecurityGroupRulePayload) SetDirection(v CreateSecurityGroupRulePayloadGetDirectionRetType) { - setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&o.Direction, v) -} - -// GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetEthertype() (res CreateSecurityGroupRulePayloadGetEthertypeRetType) { - res, _ = o.GetEthertypeOk() - return -} - -// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(o.Ethertype) -} - -// HasEthertype returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { - _, ok := o.GetEthertypeOk() - return ok -} - -// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *CreateSecurityGroupRulePayload) SetEthertype(v CreateSecurityGroupRulePayloadGetEthertypeRetType) { - setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(&o.Ethertype, v) -} - -// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() (res CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { - res, _ = o.GetIcmpParametersOk() - return -} - -// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(o.IcmpParameters) -} - -// HasIcmpParameters returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { - _, ok := o.GetIcmpParametersOk() - return ok -} - -// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { - setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(&o.IcmpParameters, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetId() (res CreateSecurityGroupRulePayloadGetIdRetType) { - 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 *CreateSecurityGroupRulePayload) GetIdOk() (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateSecurityGroupRulePayload) SetId(v CreateSecurityGroupRulePayloadGetIdRetType) { - setCreateSecurityGroupRulePayloadGetIdAttributeType(&o.Id, v) -} - -// GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetIpRange() (res CreateSecurityGroupRulePayloadGetIpRangeRetType) { - res, _ = o.GetIpRangeOk() - return -} - -// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(o.IpRange) -} - -// HasIpRange returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { - _, ok := o.GetIpRangeOk() - return ok -} - -// SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *CreateSecurityGroupRulePayload) SetIpRange(v CreateSecurityGroupRulePayloadGetIpRangeRetType) { - setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(&o.IpRange, v) -} - -// GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetPortRange() (res CreateSecurityGroupRulePayloadGetPortRangeRetType) { - res, _ = o.GetPortRangeOk() - return -} - -// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(o.PortRange) -} - -// HasPortRange returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { - _, ok := o.GetPortRangeOk() - return ok -} - -// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *CreateSecurityGroupRulePayload) SetPortRange(v CreateSecurityGroupRulePayloadGetPortRangeRetType) { - setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(&o.PortRange, v) -} - -// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() (res CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { - res, _ = o.GetRemoteSecurityGroupIdOk() - return -} - -// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) -} - -// HasRemoteSecurityGroupId returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { - _, ok := o.GetRemoteSecurityGroupIdOk() - return ok -} - -// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { - setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) -} - -// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() (res CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { - res, _ = o.GetSecurityGroupIdOk() - return -} - -// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) -} - -// HasSecurityGroupId returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { - _, ok := o.GetSecurityGroupIdOk() - return ok -} - -// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { - setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) -} - -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetProtocol() (res CreateSecurityGroupRulePayloadGetProtocolRetType) { - res, _ = o.GetProtocolOk() - return -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { - return getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(o.Protocol) -} - -// HasProtocol returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { - _, ok := o.GetProtocolOk() - return ok -} - -// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. -func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateSecurityGroupRulePayloadGetProtocolRetType) { - setCreateSecurityGroupRulePayloadGetProtocolAttributeType(&o.Protocol, v) -} - -func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(o.Direction); ok { - toSerialize["Direction"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(o.Ethertype); ok { - toSerialize["Ethertype"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { - toSerialize["IcmpParameters"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(o.IpRange); ok { - toSerialize["IpRange"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(o.PortRange); ok { - toSerialize["PortRange"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { - toSerialize["RemoteSecurityGroupId"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { - toSerialize["SecurityGroupId"] = val - } - if val, ok := getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(o.Protocol); ok { - toSerialize["Protocol"] = val - } - return toSerialize, nil -} - -type NullableCreateSecurityGroupRulePayload struct { - value *CreateSecurityGroupRulePayload - isSet bool -} - -func (v NullableCreateSecurityGroupRulePayload) Get() *CreateSecurityGroupRulePayload { - return v.value -} - -func (v *NullableCreateSecurityGroupRulePayload) Set(val *CreateSecurityGroupRulePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSecurityGroupRulePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSecurityGroupRulePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSecurityGroupRulePayload(val *CreateSecurityGroupRulePayload) *NullableCreateSecurityGroupRulePayload { - return &NullableCreateSecurityGroupRulePayload{value: val, isSet: true} -} - -func (v NullableCreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSecurityGroupRulePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_security_group_rule_payload_test.go b/services/iaasalpha/model_create_security_group_rule_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_security_group_rule_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_security_group_rule_protocol.go b/services/iaasalpha/model_create_security_group_rule_protocol.go deleted file mode 100644 index 37bafc649..000000000 --- a/services/iaasalpha/model_create_security_group_rule_protocol.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} - -/* - types and functions for protocol -*/ - -// isModel -type CreateSecurityGroupRuleProtocolGetProtocolAttributeType = *CreateProtocol -type CreateSecurityGroupRuleProtocolGetProtocolArgType = CreateProtocol -type CreateSecurityGroupRuleProtocolGetProtocolRetType = CreateProtocol - -func getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg CreateSecurityGroupRuleProtocolGetProtocolAttributeType) (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(arg *CreateSecurityGroupRuleProtocolGetProtocolAttributeType, val CreateSecurityGroupRuleProtocolGetProtocolRetType) { - *arg = &val -} - -// CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. -type CreateSecurityGroupRuleProtocol struct { - Protocol CreateSecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` -} - -// NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol 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 NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { - this := CreateSecurityGroupRuleProtocol{} - return &this -} - -// NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol 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 NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { - this := CreateSecurityGroupRuleProtocol{} - return &this -} - -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *CreateSecurityGroupRuleProtocol) GetProtocol() (res CreateSecurityGroupRuleProtocolGetProtocolRetType) { - res, _ = o.GetProtocolOk() - return -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { - return getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) -} - -// HasProtocol returns a boolean if a field has been set. -func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { - _, ok := o.GetProtocolOk() - return ok -} - -// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. -func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateSecurityGroupRuleProtocolGetProtocolRetType) { - setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) -} - -func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { - toSerialize["Protocol"] = val - } - return toSerialize, nil -} - -type NullableCreateSecurityGroupRuleProtocol struct { - value *CreateSecurityGroupRuleProtocol - isSet bool -} - -func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { - return v.value -} - -func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { - return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} -} - -func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_security_group_rule_protocol_test.go b/services/iaasalpha/model_create_security_group_rule_protocol_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_security_group_rule_protocol_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_server_networking.go b/services/iaasalpha/model_create_server_networking.go deleted file mode 100644 index cb24cad93..000000000 --- a/services/iaasalpha/model_create_server_networking.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateServerNetworking type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateServerNetworking{} - -/* - types and functions for networkId -*/ - -// isNotNullableString -type CreateServerNetworkingGetNetworkIdAttributeType = *string - -func getCreateServerNetworkingGetNetworkIdAttributeTypeOk(arg CreateServerNetworkingGetNetworkIdAttributeType) (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerNetworkingGetNetworkIdAttributeType(arg *CreateServerNetworkingGetNetworkIdAttributeType, val CreateServerNetworkingGetNetworkIdRetType) { - *arg = &val -} - -type CreateServerNetworkingGetNetworkIdArgType = string -type CreateServerNetworkingGetNetworkIdRetType = string - -// CreateServerNetworking The initial networking setup for the server creation with a network. -type CreateServerNetworking struct { - // Universally Unique Identifier (UUID). - NetworkId CreateServerNetworkingGetNetworkIdAttributeType `json:"networkId,omitempty"` -} - -// NewCreateServerNetworking instantiates a new CreateServerNetworking 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 NewCreateServerNetworking() *CreateServerNetworking { - this := CreateServerNetworking{} - return &this -} - -// NewCreateServerNetworkingWithDefaults instantiates a new CreateServerNetworking 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 NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { - this := CreateServerNetworking{} - return &this -} - -// GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *CreateServerNetworking) GetNetworkId() (res CreateServerNetworkingGetNetworkIdRetType) { - res, _ = o.GetNetworkIdOk() - return -} - -// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerNetworking) GetNetworkIdOk() (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { - return getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId) -} - -// HasNetworkId returns a boolean if a field has been set. -func (o *CreateServerNetworking) HasNetworkId() bool { - _, ok := o.GetNetworkIdOk() - return ok -} - -// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *CreateServerNetworking) SetNetworkId(v CreateServerNetworkingGetNetworkIdRetType) { - setCreateServerNetworkingGetNetworkIdAttributeType(&o.NetworkId, v) -} - -func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId); ok { - toSerialize["NetworkId"] = val - } - return toSerialize, nil -} - -type NullableCreateServerNetworking struct { - value *CreateServerNetworking - isSet bool -} - -func (v NullableCreateServerNetworking) Get() *CreateServerNetworking { - return v.value -} - -func (v *NullableCreateServerNetworking) Set(val *CreateServerNetworking) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerNetworking) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerNetworking) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerNetworking(val *CreateServerNetworking) *NullableCreateServerNetworking { - return &NullableCreateServerNetworking{value: val, isSet: true} -} - -func (v NullableCreateServerNetworking) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerNetworking) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_networking_test.go b/services/iaasalpha/model_create_server_networking_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_server_networking_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_server_networking_with_nics.go b/services/iaasalpha/model_create_server_networking_with_nics.go deleted file mode 100644 index 56ee24d9e..000000000 --- a/services/iaasalpha/model_create_server_networking_with_nics.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateServerNetworkingWithNics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateServerNetworkingWithNics{} - -/* - types and functions for nicIds -*/ - -// isArray -type CreateServerNetworkingWithNicsGetNicIdsAttributeType = *[]string -type CreateServerNetworkingWithNicsGetNicIdsArgType = []string -type CreateServerNetworkingWithNicsGetNicIdsRetType = []string - -func getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(arg CreateServerNetworkingWithNicsGetNicIdsAttributeType) (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerNetworkingWithNicsGetNicIdsAttributeType(arg *CreateServerNetworkingWithNicsGetNicIdsAttributeType, val CreateServerNetworkingWithNicsGetNicIdsRetType) { - *arg = &val -} - -// CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. -type CreateServerNetworkingWithNics struct { - // A list of UUIDs. - NicIds CreateServerNetworkingWithNicsGetNicIdsAttributeType `json:"nicIds,omitempty"` -} - -// NewCreateServerNetworkingWithNics instantiates a new CreateServerNetworkingWithNics 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 NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { - this := CreateServerNetworkingWithNics{} - return &this -} - -// NewCreateServerNetworkingWithNicsWithDefaults instantiates a new CreateServerNetworkingWithNics 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 NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWithNics { - this := CreateServerNetworkingWithNics{} - return &this -} - -// GetNicIds returns the NicIds field value if set, zero value otherwise. -func (o *CreateServerNetworkingWithNics) GetNicIds() (res CreateServerNetworkingWithNicsGetNicIdsRetType) { - res, _ = o.GetNicIdsOk() - return -} - -// GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerNetworkingWithNics) GetNicIdsOk() (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { - return getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds) -} - -// HasNicIds returns a boolean if a field has been set. -func (o *CreateServerNetworkingWithNics) HasNicIds() bool { - _, ok := o.GetNicIdsOk() - return ok -} - -// SetNicIds gets a reference to the given []string and assigns it to the NicIds field. -func (o *CreateServerNetworkingWithNics) SetNicIds(v CreateServerNetworkingWithNicsGetNicIdsRetType) { - setCreateServerNetworkingWithNicsGetNicIdsAttributeType(&o.NicIds, v) -} - -func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds); ok { - toSerialize["NicIds"] = val - } - return toSerialize, nil -} - -type NullableCreateServerNetworkingWithNics struct { - value *CreateServerNetworkingWithNics - isSet bool -} - -func (v NullableCreateServerNetworkingWithNics) Get() *CreateServerNetworkingWithNics { - return v.value -} - -func (v *NullableCreateServerNetworkingWithNics) Set(val *CreateServerNetworkingWithNics) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerNetworkingWithNics) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerNetworkingWithNics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerNetworkingWithNics(val *CreateServerNetworkingWithNics) *NullableCreateServerNetworkingWithNics { - return &NullableCreateServerNetworkingWithNics{value: val, isSet: true} -} - -func (v NullableCreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerNetworkingWithNics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_networking_with_nics_test.go b/services/iaasalpha/model_create_server_networking_with_nics_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_server_networking_with_nics_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_server_payload.go b/services/iaasalpha/model_create_server_payload.go deleted file mode 100644 index 51dabf843..000000000 --- a/services/iaasalpha/model_create_server_payload.go +++ /dev/null @@ -1,1186 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateServerPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateServerPayload{} - -/* - types and functions for affinityGroup -*/ - -// isNotNullableString -type CreateServerPayloadGetAffinityGroupAttributeType = *string - -func getCreateServerPayloadGetAffinityGroupAttributeTypeOk(arg CreateServerPayloadGetAffinityGroupAttributeType) (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetAffinityGroupAttributeType(arg *CreateServerPayloadGetAffinityGroupAttributeType, val CreateServerPayloadGetAffinityGroupRetType) { - *arg = &val -} - -type CreateServerPayloadGetAffinityGroupArgType = string -type CreateServerPayloadGetAffinityGroupRetType = string - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type CreateServerPayloadGetAvailabilityZoneAttributeType = *string - -func getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(arg CreateServerPayloadGetAvailabilityZoneAttributeType) (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetAvailabilityZoneAttributeType(arg *CreateServerPayloadGetAvailabilityZoneAttributeType, val CreateServerPayloadGetAvailabilityZoneRetType) { - *arg = &val -} - -type CreateServerPayloadGetAvailabilityZoneArgType = string -type CreateServerPayloadGetAvailabilityZoneRetType = string - -/* - types and functions for bootVolume -*/ - -// isModel -type CreateServerPayloadGetBootVolumeAttributeType = *CreateServerPayloadBootVolume -type CreateServerPayloadGetBootVolumeArgType = CreateServerPayloadBootVolume -type CreateServerPayloadGetBootVolumeRetType = CreateServerPayloadBootVolume - -func getCreateServerPayloadGetBootVolumeAttributeTypeOk(arg CreateServerPayloadGetBootVolumeAttributeType) (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetBootVolumeAttributeType(arg *CreateServerPayloadGetBootVolumeAttributeType, val CreateServerPayloadGetBootVolumeRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateServerPayloadGetCreatedAtAttributeType = *time.Time -type CreateServerPayloadGetCreatedAtArgType = time.Time -type CreateServerPayloadGetCreatedAtRetType = time.Time - -func getCreateServerPayloadGetCreatedAtAttributeTypeOk(arg CreateServerPayloadGetCreatedAtAttributeType) (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetCreatedAtAttributeType(arg *CreateServerPayloadGetCreatedAtAttributeType, val CreateServerPayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for errorMessage -*/ - -// isNotNullableString -type CreateServerPayloadGetErrorMessageAttributeType = *string - -func getCreateServerPayloadGetErrorMessageAttributeTypeOk(arg CreateServerPayloadGetErrorMessageAttributeType) (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetErrorMessageAttributeType(arg *CreateServerPayloadGetErrorMessageAttributeType, val CreateServerPayloadGetErrorMessageRetType) { - *arg = &val -} - -type CreateServerPayloadGetErrorMessageArgType = string -type CreateServerPayloadGetErrorMessageRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateServerPayloadGetIdAttributeType = *string - -func getCreateServerPayloadGetIdAttributeTypeOk(arg CreateServerPayloadGetIdAttributeType) (ret CreateServerPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetIdAttributeType(arg *CreateServerPayloadGetIdAttributeType, val CreateServerPayloadGetIdRetType) { - *arg = &val -} - -type CreateServerPayloadGetIdArgType = string -type CreateServerPayloadGetIdRetType = string - -/* - types and functions for imageId -*/ - -// isNotNullableString -type CreateServerPayloadGetImageIdAttributeType = *string - -func getCreateServerPayloadGetImageIdAttributeTypeOk(arg CreateServerPayloadGetImageIdAttributeType) (ret CreateServerPayloadGetImageIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetImageIdAttributeType(arg *CreateServerPayloadGetImageIdAttributeType, val CreateServerPayloadGetImageIdRetType) { - *arg = &val -} - -type CreateServerPayloadGetImageIdArgType = string -type CreateServerPayloadGetImageIdRetType = string - -/* - types and functions for keypairName -*/ - -// isNotNullableString -type CreateServerPayloadGetKeypairNameAttributeType = *string - -func getCreateServerPayloadGetKeypairNameAttributeTypeOk(arg CreateServerPayloadGetKeypairNameAttributeType) (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetKeypairNameAttributeType(arg *CreateServerPayloadGetKeypairNameAttributeType, val CreateServerPayloadGetKeypairNameRetType) { - *arg = &val -} - -type CreateServerPayloadGetKeypairNameArgType = string -type CreateServerPayloadGetKeypairNameRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateServerPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateServerPayloadGetLabelsArgType = map[string]interface{} -type CreateServerPayloadGetLabelsRetType = map[string]interface{} - -func getCreateServerPayloadGetLabelsAttributeTypeOk(arg CreateServerPayloadGetLabelsAttributeType) (ret CreateServerPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetLabelsAttributeType(arg *CreateServerPayloadGetLabelsAttributeType, val CreateServerPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for launchedAt -*/ - -// isDateTime -type CreateServerPayloadGetLaunchedAtAttributeType = *time.Time -type CreateServerPayloadGetLaunchedAtArgType = time.Time -type CreateServerPayloadGetLaunchedAtRetType = time.Time - -func getCreateServerPayloadGetLaunchedAtAttributeTypeOk(arg CreateServerPayloadGetLaunchedAtAttributeType) (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetLaunchedAtAttributeType(arg *CreateServerPayloadGetLaunchedAtAttributeType, val CreateServerPayloadGetLaunchedAtRetType) { - *arg = &val -} - -/* - types and functions for machineType -*/ - -// isNotNullableString -type CreateServerPayloadGetMachineTypeAttributeType = *string - -func getCreateServerPayloadGetMachineTypeAttributeTypeOk(arg CreateServerPayloadGetMachineTypeAttributeType) (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetMachineTypeAttributeType(arg *CreateServerPayloadGetMachineTypeAttributeType, val CreateServerPayloadGetMachineTypeRetType) { - *arg = &val -} - -type CreateServerPayloadGetMachineTypeArgType = string -type CreateServerPayloadGetMachineTypeRetType = string - -/* - types and functions for maintenanceWindow -*/ - -// isModel -type CreateServerPayloadGetMaintenanceWindowAttributeType = *ServerMaintenance -type CreateServerPayloadGetMaintenanceWindowArgType = ServerMaintenance -type CreateServerPayloadGetMaintenanceWindowRetType = ServerMaintenance - -func getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(arg CreateServerPayloadGetMaintenanceWindowAttributeType) (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetMaintenanceWindowAttributeType(arg *CreateServerPayloadGetMaintenanceWindowAttributeType, val CreateServerPayloadGetMaintenanceWindowRetType) { - *arg = &val -} - -/* - types and functions for metadata -*/ - -// isFreeform -type CreateServerPayloadGetMetadataAttributeType = *map[string]interface{} -type CreateServerPayloadGetMetadataArgType = map[string]interface{} -type CreateServerPayloadGetMetadataRetType = map[string]interface{} - -func getCreateServerPayloadGetMetadataAttributeTypeOk(arg CreateServerPayloadGetMetadataAttributeType) (ret CreateServerPayloadGetMetadataRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetMetadataAttributeType(arg *CreateServerPayloadGetMetadataAttributeType, val CreateServerPayloadGetMetadataRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateServerPayloadGetNameAttributeType = *string - -func getCreateServerPayloadGetNameAttributeTypeOk(arg CreateServerPayloadGetNameAttributeType) (ret CreateServerPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetNameAttributeType(arg *CreateServerPayloadGetNameAttributeType, val CreateServerPayloadGetNameRetType) { - *arg = &val -} - -type CreateServerPayloadGetNameArgType = string -type CreateServerPayloadGetNameRetType = string - -/* - types and functions for networking -*/ - -// isModel -type CreateServerPayloadGetNetworkingAttributeType = *CreateServerPayloadNetworking -type CreateServerPayloadGetNetworkingArgType = CreateServerPayloadNetworking -type CreateServerPayloadGetNetworkingRetType = CreateServerPayloadNetworking - -func getCreateServerPayloadGetNetworkingAttributeTypeOk(arg CreateServerPayloadGetNetworkingAttributeType) (ret CreateServerPayloadGetNetworkingRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetNetworkingAttributeType(arg *CreateServerPayloadGetNetworkingAttributeType, val CreateServerPayloadGetNetworkingRetType) { - *arg = &val -} - -/* - types and functions for nics -*/ - -// isArray -type CreateServerPayloadGetNicsAttributeType = *[]ServerNetwork -type CreateServerPayloadGetNicsArgType = []ServerNetwork -type CreateServerPayloadGetNicsRetType = []ServerNetwork - -func getCreateServerPayloadGetNicsAttributeTypeOk(arg CreateServerPayloadGetNicsAttributeType) (ret CreateServerPayloadGetNicsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetNicsAttributeType(arg *CreateServerPayloadGetNicsAttributeType, val CreateServerPayloadGetNicsRetType) { - *arg = &val -} - -/* - types and functions for powerStatus -*/ - -// isNotNullableString -type CreateServerPayloadGetPowerStatusAttributeType = *string - -func getCreateServerPayloadGetPowerStatusAttributeTypeOk(arg CreateServerPayloadGetPowerStatusAttributeType) (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetPowerStatusAttributeType(arg *CreateServerPayloadGetPowerStatusAttributeType, val CreateServerPayloadGetPowerStatusRetType) { - *arg = &val -} - -type CreateServerPayloadGetPowerStatusArgType = string -type CreateServerPayloadGetPowerStatusRetType = string - -/* - types and functions for securityGroups -*/ - -// isArray -type CreateServerPayloadGetSecurityGroupsAttributeType = *[]string -type CreateServerPayloadGetSecurityGroupsArgType = []string -type CreateServerPayloadGetSecurityGroupsRetType = []string - -func getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(arg CreateServerPayloadGetSecurityGroupsAttributeType) (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetSecurityGroupsAttributeType(arg *CreateServerPayloadGetSecurityGroupsAttributeType, val CreateServerPayloadGetSecurityGroupsRetType) { - *arg = &val -} - -/* - types and functions for serviceAccountMails -*/ - -// isArray -type CreateServerPayloadGetServiceAccountMailsAttributeType = *[]string -type CreateServerPayloadGetServiceAccountMailsArgType = []string -type CreateServerPayloadGetServiceAccountMailsRetType = []string - -func getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(arg CreateServerPayloadGetServiceAccountMailsAttributeType) (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetServiceAccountMailsAttributeType(arg *CreateServerPayloadGetServiceAccountMailsAttributeType, val CreateServerPayloadGetServiceAccountMailsRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateServerPayloadGetStatusAttributeType = *string - -func getCreateServerPayloadGetStatusAttributeTypeOk(arg CreateServerPayloadGetStatusAttributeType) (ret CreateServerPayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetStatusAttributeType(arg *CreateServerPayloadGetStatusAttributeType, val CreateServerPayloadGetStatusRetType) { - *arg = &val -} - -type CreateServerPayloadGetStatusArgType = string -type CreateServerPayloadGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateServerPayloadGetUpdatedAtAttributeType = *time.Time -type CreateServerPayloadGetUpdatedAtArgType = time.Time -type CreateServerPayloadGetUpdatedAtRetType = time.Time - -func getCreateServerPayloadGetUpdatedAtAttributeTypeOk(arg CreateServerPayloadGetUpdatedAtAttributeType) (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetUpdatedAtAttributeType(arg *CreateServerPayloadGetUpdatedAtAttributeType, val CreateServerPayloadGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for userData -*/ - -// isByteArray -type CreateServerPayloadGetUserDataAttributeType = *[]byte -type CreateServerPayloadGetUserDataArgType = []byte -type CreateServerPayloadGetUserDataRetType = []byte - -func getCreateServerPayloadGetUserDataAttributeTypeOk(arg CreateServerPayloadGetUserDataAttributeType) (ret CreateServerPayloadGetUserDataRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetUserDataAttributeType(arg *CreateServerPayloadGetUserDataAttributeType, val CreateServerPayloadGetUserDataRetType) { - *arg = &val -} - -/* - types and functions for volumes -*/ - -// isArray -type CreateServerPayloadGetVolumesAttributeType = *[]string -type CreateServerPayloadGetVolumesArgType = []string -type CreateServerPayloadGetVolumesRetType = []string - -func getCreateServerPayloadGetVolumesAttributeTypeOk(arg CreateServerPayloadGetVolumesAttributeType) (ret CreateServerPayloadGetVolumesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadGetVolumesAttributeType(arg *CreateServerPayloadGetVolumesAttributeType, val CreateServerPayloadGetVolumesRetType) { - *arg = &val -} - -// CreateServerPayload Representation of a single server object. -type CreateServerPayload struct { - // Universally Unique Identifier (UUID). - AffinityGroup CreateServerPayloadGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` - // Object that represents an availability zone. - AvailabilityZone CreateServerPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` - BootVolume CreateServerPayloadGetBootVolumeAttributeType `json:"bootVolume,omitempty"` - // Date-time when resource was created. - CreatedAt CreateServerPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // An error message. - ErrorMessage CreateServerPayloadGetErrorMessageAttributeType `json:"errorMessage,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateServerPayloadGetIdAttributeType `json:"id,omitempty"` - // Universally Unique Identifier (UUID). - ImageId CreateServerPayloadGetImageIdAttributeType `json:"imageId,omitempty"` - // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - KeypairName CreateServerPayloadGetKeypairNameAttributeType `json:"keypairName,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Date-time when resource was launched. - LaunchedAt CreateServerPayloadGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - MachineType CreateServerPayloadGetMachineTypeAttributeType `json:"machineType" required:"true"` - MaintenanceWindow CreateServerPayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` - // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. - Metadata CreateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` - // The name for a Server. - // REQUIRED - Name CreateServerPayloadGetNameAttributeType `json:"name" required:"true"` - Networking CreateServerPayloadGetNetworkingAttributeType `json:"networking,omitempty"` - // 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`. - PowerStatus CreateServerPayloadGetPowerStatusAttributeType `json:"powerStatus,omitempty"` - // A list of General Objects. - SecurityGroups CreateServerPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` - // A list of service account mails. - ServiceAccountMails CreateServerPayloadGetServiceAccountMailsAttributeType `json:"serviceAccountMails,omitempty"` - // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. - Status CreateServerPayloadGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt CreateServerPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. - UserData CreateServerPayloadGetUserDataAttributeType `json:"userData,omitempty"` - // A list of UUIDs. - Volumes CreateServerPayloadGetVolumesAttributeType `json:"volumes,omitempty"` -} - -type _CreateServerPayload CreateServerPayload - -// NewCreateServerPayload instantiates a new CreateServerPayload 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 NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType, name CreateServerPayloadGetNameArgType) *CreateServerPayload { - this := CreateServerPayload{} - setCreateServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) - setCreateServerPayloadGetNameAttributeType(&this.Name, name) - return &this -} - -// NewCreateServerPayloadWithDefaults instantiates a new CreateServerPayload 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 NewCreateServerPayloadWithDefaults() *CreateServerPayload { - this := CreateServerPayload{} - return &this -} - -// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. -func (o *CreateServerPayload) GetAffinityGroup() (res CreateServerPayloadGetAffinityGroupRetType) { - res, _ = o.GetAffinityGroupOk() - return -} - -// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetAffinityGroupOk() (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { - return getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup) -} - -// HasAffinityGroup returns a boolean if a field has been set. -func (o *CreateServerPayload) HasAffinityGroup() bool { - _, ok := o.GetAffinityGroupOk() - return ok -} - -// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. -func (o *CreateServerPayload) SetAffinityGroup(v CreateServerPayloadGetAffinityGroupRetType) { - setCreateServerPayloadGetAffinityGroupAttributeType(&o.AffinityGroup, v) -} - -// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *CreateServerPayload) GetAvailabilityZone() (res CreateServerPayloadGetAvailabilityZoneRetType) { - res, _ = o.GetAvailabilityZoneOk() - return -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetAvailabilityZoneOk() (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { - return getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// HasAvailabilityZone returns a boolean if a field has been set. -func (o *CreateServerPayload) HasAvailabilityZone() bool { - _, ok := o.GetAvailabilityZoneOk() - return ok -} - -// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *CreateServerPayload) SetAvailabilityZone(v CreateServerPayloadGetAvailabilityZoneRetType) { - setCreateServerPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetBootVolume returns the BootVolume field value if set, zero value otherwise. -func (o *CreateServerPayload) GetBootVolume() (res CreateServerPayloadGetBootVolumeRetType) { - res, _ = o.GetBootVolumeOk() - return -} - -// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetBootVolumeOk() (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { - return getCreateServerPayloadGetBootVolumeAttributeTypeOk(o.BootVolume) -} - -// HasBootVolume returns a boolean if a field has been set. -func (o *CreateServerPayload) HasBootVolume() bool { - _, ok := o.GetBootVolumeOk() - return ok -} - -// SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. -func (o *CreateServerPayload) SetBootVolume(v CreateServerPayloadGetBootVolumeRetType) { - setCreateServerPayloadGetBootVolumeAttributeType(&o.BootVolume, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetCreatedAt() (res CreateServerPayloadGetCreatedAtRetType) { - 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 *CreateServerPayload) GetCreatedAtOk() (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { - return getCreateServerPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateServerPayload) 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 *CreateServerPayload) SetCreatedAt(v CreateServerPayloadGetCreatedAtRetType) { - setCreateServerPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *CreateServerPayload) GetErrorMessage() (res CreateServerPayloadGetErrorMessageRetType) { - res, _ = o.GetErrorMessageOk() - return -} - -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetErrorMessageOk() (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { - return getCreateServerPayloadGetErrorMessageAttributeTypeOk(o.ErrorMessage) -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *CreateServerPayload) HasErrorMessage() bool { - _, ok := o.GetErrorMessageOk() - return ok -} - -// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *CreateServerPayload) SetErrorMessage(v CreateServerPayloadGetErrorMessageRetType) { - setCreateServerPayloadGetErrorMessageAttributeType(&o.ErrorMessage, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateServerPayload) GetId() (res CreateServerPayloadGetIdRetType) { - 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 *CreateServerPayload) GetIdOk() (ret CreateServerPayloadGetIdRetType, ok bool) { - return getCreateServerPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateServerPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateServerPayload) SetId(v CreateServerPayloadGetIdRetType) { - setCreateServerPayloadGetIdAttributeType(&o.Id, v) -} - -// GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *CreateServerPayload) GetImageId() (res CreateServerPayloadGetImageIdRetType) { - res, _ = o.GetImageIdOk() - return -} - -// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetImageIdOk() (ret CreateServerPayloadGetImageIdRetType, ok bool) { - return getCreateServerPayloadGetImageIdAttributeTypeOk(o.ImageId) -} - -// HasImageId returns a boolean if a field has been set. -func (o *CreateServerPayload) HasImageId() bool { - _, ok := o.GetImageIdOk() - return ok -} - -// SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *CreateServerPayload) SetImageId(v CreateServerPayloadGetImageIdRetType) { - setCreateServerPayloadGetImageIdAttributeType(&o.ImageId, v) -} - -// GetKeypairName returns the KeypairName field value if set, zero value otherwise. -func (o *CreateServerPayload) GetKeypairName() (res CreateServerPayloadGetKeypairNameRetType) { - res, _ = o.GetKeypairNameOk() - return -} - -// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetKeypairNameOk() (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { - return getCreateServerPayloadGetKeypairNameAttributeTypeOk(o.KeypairName) -} - -// HasKeypairName returns a boolean if a field has been set. -func (o *CreateServerPayload) HasKeypairName() bool { - _, ok := o.GetKeypairNameOk() - return ok -} - -// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. -func (o *CreateServerPayload) SetKeypairName(v CreateServerPayloadGetKeypairNameRetType) { - setCreateServerPayloadGetKeypairNameAttributeType(&o.KeypairName, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateServerPayload) GetLabels() (res CreateServerPayloadGetLabelsRetType) { - 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 *CreateServerPayload) GetLabelsOk() (ret CreateServerPayloadGetLabelsRetType, ok bool) { - return getCreateServerPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateServerPayload) 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 *CreateServerPayload) SetLabels(v CreateServerPayloadGetLabelsRetType) { - setCreateServerPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetLaunchedAt() (res CreateServerPayloadGetLaunchedAtRetType) { - res, _ = o.GetLaunchedAtOk() - return -} - -// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetLaunchedAtOk() (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { - return getCreateServerPayloadGetLaunchedAtAttributeTypeOk(o.LaunchedAt) -} - -// HasLaunchedAt returns a boolean if a field has been set. -func (o *CreateServerPayload) HasLaunchedAt() bool { - _, ok := o.GetLaunchedAtOk() - return ok -} - -// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. -func (o *CreateServerPayload) SetLaunchedAt(v CreateServerPayloadGetLaunchedAtRetType) { - setCreateServerPayloadGetLaunchedAtAttributeType(&o.LaunchedAt, v) -} - -// GetMachineType returns the MachineType field value -func (o *CreateServerPayload) GetMachineType() (ret CreateServerPayloadGetMachineTypeRetType) { - ret, _ = o.GetMachineTypeOk() - return ret -} - -// GetMachineTypeOk returns a tuple with the MachineType field value -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetMachineTypeOk() (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { - return getCreateServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) -} - -// SetMachineType sets field value -func (o *CreateServerPayload) SetMachineType(v CreateServerPayloadGetMachineTypeRetType) { - setCreateServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) -} - -// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. -func (o *CreateServerPayload) GetMaintenanceWindow() (res CreateServerPayloadGetMaintenanceWindowRetType) { - res, _ = o.GetMaintenanceWindowOk() - return -} - -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetMaintenanceWindowOk() (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { - return getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) -} - -// HasMaintenanceWindow returns a boolean if a field has been set. -func (o *CreateServerPayload) HasMaintenanceWindow() bool { - _, ok := o.GetMaintenanceWindowOk() - return ok -} - -// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. -func (o *CreateServerPayload) SetMaintenanceWindow(v CreateServerPayloadGetMaintenanceWindowRetType) { - setCreateServerPayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *CreateServerPayload) GetMetadata() (res CreateServerPayloadGetMetadataRetType) { - res, _ = o.GetMetadataOk() - return -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetMetadataOk() (ret CreateServerPayloadGetMetadataRetType, ok bool) { - return getCreateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) -} - -// HasMetadata returns a boolean if a field has been set. -func (o *CreateServerPayload) HasMetadata() bool { - _, ok := o.GetMetadataOk() - return ok -} - -// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. -func (o *CreateServerPayload) SetMetadata(v CreateServerPayloadGetMetadataRetType) { - setCreateServerPayloadGetMetadataAttributeType(&o.Metadata, v) -} - -// GetName returns the Name field value -func (o *CreateServerPayload) GetName() (ret CreateServerPayloadGetNameRetType) { - 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 *CreateServerPayload) GetNameOk() (ret CreateServerPayloadGetNameRetType, ok bool) { - return getCreateServerPayloadGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -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 -} - -// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise -// 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. -func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadGetNetworkingRetType) { - setCreateServerPayloadGetNetworkingAttributeType(&o.Networking, v) -} - -// GetNics returns the Nics field value if set, zero value otherwise. -func (o *CreateServerPayload) GetNics() (res CreateServerPayloadGetNicsRetType) { - res, _ = o.GetNicsOk() - return -} - -// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetNicsOk() (ret CreateServerPayloadGetNicsRetType, ok bool) { - return getCreateServerPayloadGetNicsAttributeTypeOk(o.Nics) -} - -// HasNics returns a boolean if a field has been set. -func (o *CreateServerPayload) HasNics() bool { - _, ok := o.GetNicsOk() - return ok -} - -// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. -func (o *CreateServerPayload) SetNics(v CreateServerPayloadGetNicsRetType) { - setCreateServerPayloadGetNicsAttributeType(&o.Nics, v) -} - -// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. -func (o *CreateServerPayload) GetPowerStatus() (res CreateServerPayloadGetPowerStatusRetType) { - res, _ = o.GetPowerStatusOk() - return -} - -// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetPowerStatusOk() (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { - return getCreateServerPayloadGetPowerStatusAttributeTypeOk(o.PowerStatus) -} - -// HasPowerStatus returns a boolean if a field has been set. -func (o *CreateServerPayload) HasPowerStatus() bool { - _, ok := o.GetPowerStatusOk() - return ok -} - -// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. -func (o *CreateServerPayload) SetPowerStatus(v CreateServerPayloadGetPowerStatusRetType) { - setCreateServerPayloadGetPowerStatusAttributeType(&o.PowerStatus, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *CreateServerPayload) GetSecurityGroups() (res CreateServerPayloadGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetSecurityGroupsOk() (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { - return getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *CreateServerPayload) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *CreateServerPayload) SetSecurityGroups(v CreateServerPayloadGetSecurityGroupsRetType) { - setCreateServerPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. -func (o *CreateServerPayload) GetServiceAccountMails() (res CreateServerPayloadGetServiceAccountMailsRetType) { - res, _ = o.GetServiceAccountMailsOk() - return -} - -// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetServiceAccountMailsOk() (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { - return getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) -} - -// HasServiceAccountMails returns a boolean if a field has been set. -func (o *CreateServerPayload) HasServiceAccountMails() bool { - _, ok := o.GetServiceAccountMailsOk() - return ok -} - -// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. -func (o *CreateServerPayload) SetServiceAccountMails(v CreateServerPayloadGetServiceAccountMailsRetType) { - setCreateServerPayloadGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateServerPayload) GetStatus() (res CreateServerPayloadGetStatusRetType) { - 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 *CreateServerPayload) GetStatusOk() (ret CreateServerPayloadGetStatusRetType, ok bool) { - return getCreateServerPayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateServerPayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateServerPayload) SetStatus(v CreateServerPayloadGetStatusRetType) { - setCreateServerPayloadGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetUpdatedAt() (res CreateServerPayloadGetUpdatedAtRetType) { - 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 *CreateServerPayload) GetUpdatedAtOk() (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { - return getCreateServerPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateServerPayload) 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 *CreateServerPayload) SetUpdatedAt(v CreateServerPayloadGetUpdatedAtRetType) { - setCreateServerPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetUserData returns the UserData field value if set, zero value otherwise. -func (o *CreateServerPayload) GetUserData() (res CreateServerPayloadGetUserDataRetType) { - res, _ = o.GetUserDataOk() - return -} - -// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetUserDataOk() (ret CreateServerPayloadGetUserDataRetType, ok bool) { - return getCreateServerPayloadGetUserDataAttributeTypeOk(o.UserData) -} - -// HasUserData returns a boolean if a field has been set. -func (o *CreateServerPayload) HasUserData() bool { - _, ok := o.GetUserDataOk() - return ok -} - -// SetUserData gets a reference to the given string and assigns it to the UserData field. -func (o *CreateServerPayload) SetUserData(v CreateServerPayloadGetUserDataRetType) { - setCreateServerPayloadGetUserDataAttributeType(&o.UserData, v) -} - -// GetVolumes returns the Volumes field value if set, zero value otherwise. -func (o *CreateServerPayload) GetVolumes() (res CreateServerPayloadGetVolumesRetType) { - res, _ = o.GetVolumesOk() - return -} - -// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetVolumesOk() (ret CreateServerPayloadGetVolumesRetType, ok bool) { - return getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes) -} - -// HasVolumes returns a boolean if a field has been set. -func (o *CreateServerPayload) HasVolumes() bool { - _, ok := o.GetVolumesOk() - return ok -} - -// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. -func (o *CreateServerPayload) SetVolumes(v CreateServerPayloadGetVolumesRetType) { - setCreateServerPayloadGetVolumesAttributeType(&o.Volumes, v) -} - -func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { - toSerialize["AffinityGroup"] = val - } - if val, ok := getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getCreateServerPayloadGetBootVolumeAttributeTypeOk(o.BootVolume); ok { - toSerialize["BootVolume"] = val - } - if val, ok := getCreateServerPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateServerPayloadGetErrorMessageAttributeTypeOk(o.ErrorMessage); ok { - toSerialize["ErrorMessage"] = val - } - if val, ok := getCreateServerPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateServerPayloadGetImageIdAttributeTypeOk(o.ImageId); ok { - toSerialize["ImageId"] = val - } - if val, ok := getCreateServerPayloadGetKeypairNameAttributeTypeOk(o.KeypairName); ok { - toSerialize["KeypairName"] = val - } - if val, ok := getCreateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateServerPayloadGetLaunchedAtAttributeTypeOk(o.LaunchedAt); ok { - toSerialize["LaunchedAt"] = val - } - if val, ok := getCreateServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType); ok { - toSerialize["MachineType"] = val - } - if val, ok := getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { - toSerialize["MaintenanceWindow"] = val - } - if val, ok := getCreateServerPayloadGetMetadataAttributeTypeOk(o.Metadata); ok { - toSerialize["Metadata"] = val - } - if val, ok := getCreateServerPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateServerPayloadGetNetworkingAttributeTypeOk(o.Networking); ok { - toSerialize["Networking"] = val - } - if val, ok := getCreateServerPayloadGetNicsAttributeTypeOk(o.Nics); ok { - toSerialize["Nics"] = val - } - if val, ok := getCreateServerPayloadGetPowerStatusAttributeTypeOk(o.PowerStatus); ok { - toSerialize["PowerStatus"] = val - } - if val, ok := getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - if val, ok := getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails); ok { - toSerialize["ServiceAccountMails"] = val - } - if val, ok := getCreateServerPayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getCreateServerPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getCreateServerPayloadGetUserDataAttributeTypeOk(o.UserData); ok { - toSerialize["UserData"] = val - } - if val, ok := getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes); ok { - toSerialize["Volumes"] = val - } - return toSerialize, nil -} - -type NullableCreateServerPayload struct { - value *CreateServerPayload - isSet bool -} - -func (v NullableCreateServerPayload) Get() *CreateServerPayload { - return v.value -} - -func (v *NullableCreateServerPayload) Set(val *CreateServerPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerPayload(val *CreateServerPayload) *NullableCreateServerPayload { - return &NullableCreateServerPayload{value: val, isSet: true} -} - -func (v NullableCreateServerPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_payload_boot_volume.go b/services/iaasalpha/model_create_server_payload_boot_volume.go deleted file mode 100644 index 57334ff25..000000000 --- a/services/iaasalpha/model_create_server_payload_boot_volume.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateServerPayloadBootVolume type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateServerPayloadBootVolume{} - -/* - types and functions for deleteOnTermination -*/ - -// isBoolean -type CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType = *bool -type CreateServerPayloadBootVolumegetDeleteOnTerminationArgType = bool -type CreateServerPayloadBootVolumegetDeleteOnTerminationRetType = bool - -func getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(arg CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType) (ret CreateServerPayloadBootVolumegetDeleteOnTerminationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType(arg *CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType, val CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateServerPayloadBootVolumeGetIdAttributeType = *string - -func getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(arg CreateServerPayloadBootVolumeGetIdAttributeType) (ret CreateServerPayloadBootVolumeGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadBootVolumeGetIdAttributeType(arg *CreateServerPayloadBootVolumeGetIdAttributeType, val CreateServerPayloadBootVolumeGetIdRetType) { - *arg = &val -} - -type CreateServerPayloadBootVolumeGetIdArgType = string -type CreateServerPayloadBootVolumeGetIdRetType = string - -/* - types and functions for performanceClass -*/ - -// isNotNullableString -type CreateServerPayloadBootVolumeGetPerformanceClassAttributeType = *string - -func getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(arg CreateServerPayloadBootVolumeGetPerformanceClassAttributeType) (ret CreateServerPayloadBootVolumeGetPerformanceClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadBootVolumeGetPerformanceClassAttributeType(arg *CreateServerPayloadBootVolumeGetPerformanceClassAttributeType, val CreateServerPayloadBootVolumeGetPerformanceClassRetType) { - *arg = &val -} - -type CreateServerPayloadBootVolumeGetPerformanceClassArgType = string -type CreateServerPayloadBootVolumeGetPerformanceClassRetType = string - -/* - types and functions for size -*/ - -// isLong -type CreateServerPayloadBootVolumeGetSizeAttributeType = *int64 -type CreateServerPayloadBootVolumeGetSizeArgType = int64 -type CreateServerPayloadBootVolumeGetSizeRetType = int64 - -func getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(arg CreateServerPayloadBootVolumeGetSizeAttributeType) (ret CreateServerPayloadBootVolumeGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadBootVolumeGetSizeAttributeType(arg *CreateServerPayloadBootVolumeGetSizeAttributeType, val CreateServerPayloadBootVolumeGetSizeRetType) { - *arg = &val -} - -/* - types and functions for source -*/ - -// isModel -type CreateServerPayloadBootVolumeGetSourceAttributeType = *BootVolumeSource -type CreateServerPayloadBootVolumeGetSourceArgType = BootVolumeSource -type CreateServerPayloadBootVolumeGetSourceRetType = BootVolumeSource - -func getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(arg CreateServerPayloadBootVolumeGetSourceAttributeType) (ret CreateServerPayloadBootVolumeGetSourceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateServerPayloadBootVolumeGetSourceAttributeType(arg *CreateServerPayloadBootVolumeGetSourceAttributeType, val CreateServerPayloadBootVolumeGetSourceRetType) { - *arg = &val -} - -// CreateServerPayloadBootVolume struct for CreateServerPayloadBootVolume -type CreateServerPayloadBootVolume struct { - // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateServerPayloadBootVolumeGetIdAttributeType `json:"id,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass CreateServerPayloadBootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` - // Size in Gigabyte. - Size CreateServerPayloadBootVolumeGetSizeAttributeType `json:"size,omitempty"` - Source CreateServerPayloadBootVolumeGetSourceAttributeType `json:"source,omitempty"` -} - -// NewCreateServerPayloadBootVolume instantiates a new CreateServerPayloadBootVolume 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 NewCreateServerPayloadBootVolume() *CreateServerPayloadBootVolume { - this := CreateServerPayloadBootVolume{} - return &this -} - -// NewCreateServerPayloadBootVolumeWithDefaults instantiates a new CreateServerPayloadBootVolume 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 NewCreateServerPayloadBootVolumeWithDefaults() *CreateServerPayloadBootVolume { - this := CreateServerPayloadBootVolume{} - return &this -} - -// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetDeleteOnTermination() (res CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { - 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 *CreateServerPayloadBootVolume) GetDeleteOnTerminationOk() (ret CreateServerPayloadBootVolumegetDeleteOnTerminationRetType, ok bool) { - return getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) -} - -// HasDeleteOnTermination returns a boolean if a field has been set. -func (o *CreateServerPayloadBootVolume) HasDeleteOnTermination() bool { - _, ok := o.GetDeleteOnTerminationOk() - return ok -} - -// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *CreateServerPayloadBootVolume) SetDeleteOnTermination(v CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { - setCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetId() (res CreateServerPayloadBootVolumeGetIdRetType) { - 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 *CreateServerPayloadBootVolume) GetIdOk() (ret CreateServerPayloadBootVolumeGetIdRetType, ok bool) { - return getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateServerPayloadBootVolume) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateServerPayloadBootVolume) SetId(v CreateServerPayloadBootVolumeGetIdRetType) { - setCreateServerPayloadBootVolumeGetIdAttributeType(&o.Id, v) -} - -// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetPerformanceClass() (res CreateServerPayloadBootVolumeGetPerformanceClassRetType) { - 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 *CreateServerPayloadBootVolume) GetPerformanceClassOk() (ret CreateServerPayloadBootVolumeGetPerformanceClassRetType, ok bool) { - return getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) -} - -// HasPerformanceClass returns a boolean if a field has been set. -func (o *CreateServerPayloadBootVolume) HasPerformanceClass() bool { - _, ok := o.GetPerformanceClassOk() - return ok -} - -// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *CreateServerPayloadBootVolume) SetPerformanceClass(v CreateServerPayloadBootVolumeGetPerformanceClassRetType) { - setCreateServerPayloadBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetSize() (res CreateServerPayloadBootVolumeGetSizeRetType) { - 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 *CreateServerPayloadBootVolume) GetSizeOk() (ret CreateServerPayloadBootVolumeGetSizeRetType, ok bool) { - return getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *CreateServerPayloadBootVolume) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *CreateServerPayloadBootVolume) SetSize(v CreateServerPayloadBootVolumeGetSizeRetType) { - setCreateServerPayloadBootVolumeGetSizeAttributeType(&o.Size, v) -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetSource() (res CreateServerPayloadBootVolumeGetSourceRetType) { - 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 *CreateServerPayloadBootVolume) GetSourceOk() (ret CreateServerPayloadBootVolumeGetSourceRetType, ok bool) { - return getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(o.Source) -} - -// HasSource returns a boolean if a field has been set. -func (o *CreateServerPayloadBootVolume) HasSource() bool { - _, ok := o.GetSourceOk() - return ok -} - -// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. -func (o *CreateServerPayloadBootVolume) SetSource(v CreateServerPayloadBootVolumeGetSourceRetType) { - setCreateServerPayloadBootVolumeGetSourceAttributeType(&o.Source, v) -} - -func (o CreateServerPayloadBootVolume) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { - toSerialize["DeleteOnTermination"] = val - } - if val, ok := getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { - toSerialize["PerformanceClass"] = val - } - if val, ok := getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(o.Source); ok { - toSerialize["Source"] = val - } - return toSerialize, nil -} - -type NullableCreateServerPayloadBootVolume struct { - value *CreateServerPayloadBootVolume - isSet bool -} - -func (v NullableCreateServerPayloadBootVolume) Get() *CreateServerPayloadBootVolume { - return v.value -} - -func (v *NullableCreateServerPayloadBootVolume) Set(val *CreateServerPayloadBootVolume) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerPayloadBootVolume) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerPayloadBootVolume) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerPayloadBootVolume(val *CreateServerPayloadBootVolume) *NullableCreateServerPayloadBootVolume { - return &NullableCreateServerPayloadBootVolume{value: val, isSet: true} -} - -func (v NullableCreateServerPayloadBootVolume) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerPayloadBootVolume) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_payload_boot_volume_test.go b/services/iaasalpha/model_create_server_payload_boot_volume_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_server_payload_boot_volume_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_server_payload_networking.go b/services/iaasalpha/model_create_server_payload_networking.go deleted file mode 100644 index 88abe93bf..000000000 --- a/services/iaasalpha/model_create_server_payload_networking.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "fmt" -) - -// CreateServerPayloadNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. -type CreateServerPayloadNetworking struct { - CreateServerNetworking *CreateServerNetworking - CreateServerNetworkingWithNics *CreateServerNetworkingWithNics -} - -// CreateServerNetworkingAsCreateServerPayloadNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadNetworking -func CreateServerNetworkingAsCreateServerPayloadNetworking(v *CreateServerNetworking) CreateServerPayloadNetworking { - return CreateServerPayloadNetworking{ - CreateServerNetworking: v, - } -} - -// CreateServerNetworkingWithNicsAsCreateServerPayloadNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadNetworking -func CreateServerNetworkingWithNicsAsCreateServerPayloadNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadNetworking { - return CreateServerPayloadNetworking{ - CreateServerNetworkingWithNics: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateServerPayloadNetworking) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into CreateServerNetworking - err = newStrictDecoder(data).Decode(&dst.CreateServerNetworking) - if err == nil { - jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) - if string(jsonCreateServerNetworking) == "{}" { // empty struct - dst.CreateServerNetworking = nil - } else { - match++ - } - } else { - dst.CreateServerNetworking = nil - } - - // try to unmarshal data into CreateServerNetworkingWithNics - err = newStrictDecoder(data).Decode(&dst.CreateServerNetworkingWithNics) - if err == nil { - jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) - if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct - dst.CreateServerNetworkingWithNics = nil - } else { - match++ - } - } else { - dst.CreateServerNetworkingWithNics = nil - } - - 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(CreateServerPayloadNetworking)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(CreateServerPayloadNetworking)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateServerPayloadNetworking) 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 *CreateServerPayloadNetworking) 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 NullableCreateServerPayloadNetworking struct { - value *CreateServerPayloadNetworking - isSet bool -} - -func (v NullableCreateServerPayloadNetworking) Get() *CreateServerPayloadNetworking { - return v.value -} - -func (v *NullableCreateServerPayloadNetworking) Set(val *CreateServerPayloadNetworking) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerPayloadNetworking) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerPayloadNetworking) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerPayloadNetworking(val *CreateServerPayloadNetworking) *NullableCreateServerPayloadNetworking { - return &NullableCreateServerPayloadNetworking{value: val, isSet: true} -} - -func (v NullableCreateServerPayloadNetworking) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerPayloadNetworking) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_payload_networking_test.go b/services/iaasalpha/model_create_server_payload_networking_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_server_payload_networking_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_server_payload_test.go b/services/iaasalpha/model_create_server_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_server_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_snapshot_payload.go b/services/iaasalpha/model_create_snapshot_payload.go deleted file mode 100644 index 0fd6a1320..000000000 --- a/services/iaasalpha/model_create_snapshot_payload.go +++ /dev/null @@ -1,467 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateSnapshotPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateSnapshotPayload{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateSnapshotPayloadGetCreatedAtAttributeType = *time.Time -type CreateSnapshotPayloadGetCreatedAtArgType = time.Time -type CreateSnapshotPayloadGetCreatedAtRetType = time.Time - -func getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetCreatedAtAttributeType) (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetCreatedAtAttributeType(arg *CreateSnapshotPayloadGetCreatedAtAttributeType, val CreateSnapshotPayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateSnapshotPayloadGetIdAttributeType = *string - -func getCreateSnapshotPayloadGetIdAttributeTypeOk(arg CreateSnapshotPayloadGetIdAttributeType) (ret CreateSnapshotPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetIdAttributeType(arg *CreateSnapshotPayloadGetIdAttributeType, val CreateSnapshotPayloadGetIdRetType) { - *arg = &val -} - -type CreateSnapshotPayloadGetIdArgType = string -type CreateSnapshotPayloadGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateSnapshotPayloadGetLabelsArgType = map[string]interface{} -type CreateSnapshotPayloadGetLabelsRetType = map[string]interface{} - -func getCreateSnapshotPayloadGetLabelsAttributeTypeOk(arg CreateSnapshotPayloadGetLabelsAttributeType) (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetLabelsAttributeType(arg *CreateSnapshotPayloadGetLabelsAttributeType, val CreateSnapshotPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateSnapshotPayloadGetNameAttributeType = *string - -func getCreateSnapshotPayloadGetNameAttributeTypeOk(arg CreateSnapshotPayloadGetNameAttributeType) (ret CreateSnapshotPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetNameAttributeType(arg *CreateSnapshotPayloadGetNameAttributeType, val CreateSnapshotPayloadGetNameRetType) { - *arg = &val -} - -type CreateSnapshotPayloadGetNameArgType = string -type CreateSnapshotPayloadGetNameRetType = string - -/* - types and functions for size -*/ - -// isLong -type CreateSnapshotPayloadGetSizeAttributeType = *int64 -type CreateSnapshotPayloadGetSizeArgType = int64 -type CreateSnapshotPayloadGetSizeRetType = int64 - -func getCreateSnapshotPayloadGetSizeAttributeTypeOk(arg CreateSnapshotPayloadGetSizeAttributeType) (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetSizeAttributeType(arg *CreateSnapshotPayloadGetSizeAttributeType, val CreateSnapshotPayloadGetSizeRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateSnapshotPayloadGetStatusAttributeType = *string - -func getCreateSnapshotPayloadGetStatusAttributeTypeOk(arg CreateSnapshotPayloadGetStatusAttributeType) (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetStatusAttributeType(arg *CreateSnapshotPayloadGetStatusAttributeType, val CreateSnapshotPayloadGetStatusRetType) { - *arg = &val -} - -type CreateSnapshotPayloadGetStatusArgType = string -type CreateSnapshotPayloadGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateSnapshotPayloadGetUpdatedAtAttributeType = *time.Time -type CreateSnapshotPayloadGetUpdatedAtArgType = time.Time -type CreateSnapshotPayloadGetUpdatedAtRetType = time.Time - -func getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetUpdatedAtAttributeType) (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetUpdatedAtAttributeType(arg *CreateSnapshotPayloadGetUpdatedAtAttributeType, val CreateSnapshotPayloadGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type CreateSnapshotPayloadGetVolumeIdAttributeType = *string - -func getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(arg CreateSnapshotPayloadGetVolumeIdAttributeType) (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateSnapshotPayloadGetVolumeIdAttributeType(arg *CreateSnapshotPayloadGetVolumeIdAttributeType, val CreateSnapshotPayloadGetVolumeIdRetType) { - *arg = &val -} - -type CreateSnapshotPayloadGetVolumeIdArgType = string -type CreateSnapshotPayloadGetVolumeIdRetType = string - -// CreateSnapshotPayload Object that represents a snapshot. -type CreateSnapshotPayload struct { - // Date-time when resource was created. - CreatedAt CreateSnapshotPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateSnapshotPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name CreateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` - // Size in Gigabyte. - Size CreateSnapshotPayloadGetSizeAttributeType `json:"size,omitempty"` - // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. - Status CreateSnapshotPayloadGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt CreateSnapshotPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // Universally Unique Identifier (UUID). - // REQUIRED - VolumeId CreateSnapshotPayloadGetVolumeIdAttributeType `json:"volumeId" required:"true"` -} - -type _CreateSnapshotPayload CreateSnapshotPayload - -// NewCreateSnapshotPayload instantiates a new CreateSnapshotPayload 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 NewCreateSnapshotPayload(volumeId CreateSnapshotPayloadGetVolumeIdArgType) *CreateSnapshotPayload { - this := CreateSnapshotPayload{} - setCreateSnapshotPayloadGetVolumeIdAttributeType(&this.VolumeId, volumeId) - return &this -} - -// NewCreateSnapshotPayloadWithDefaults instantiates a new CreateSnapshotPayload 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 NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { - this := CreateSnapshotPayload{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetCreatedAt() (res CreateSnapshotPayloadGetCreatedAtRetType) { - 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 *CreateSnapshotPayload) GetCreatedAtOk() (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { - return getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetCreatedAt(v CreateSnapshotPayloadGetCreatedAtRetType) { - setCreateSnapshotPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetId() (res CreateSnapshotPayloadGetIdRetType) { - 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 *CreateSnapshotPayload) GetIdOk() (ret CreateSnapshotPayloadGetIdRetType, ok bool) { - return getCreateSnapshotPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateSnapshotPayload) SetId(v CreateSnapshotPayloadGetIdRetType) { - setCreateSnapshotPayloadGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetLabels() (res CreateSnapshotPayloadGetLabelsRetType) { - 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 *CreateSnapshotPayload) GetLabelsOk() (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { - return getCreateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetLabels(v CreateSnapshotPayloadGetLabelsRetType) { - setCreateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetName() (res CreateSnapshotPayloadGetNameRetType) { - 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 *CreateSnapshotPayload) GetNameOk() (ret CreateSnapshotPayloadGetNameRetType, ok bool) { - return getCreateSnapshotPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateSnapshotPayload) SetName(v CreateSnapshotPayloadGetNameRetType) { - setCreateSnapshotPayloadGetNameAttributeType(&o.Name, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetSize() (res CreateSnapshotPayloadGetSizeRetType) { - 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 *CreateSnapshotPayload) GetSizeOk() (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { - return getCreateSnapshotPayloadGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *CreateSnapshotPayload) SetSize(v CreateSnapshotPayloadGetSizeRetType) { - setCreateSnapshotPayloadGetSizeAttributeType(&o.Size, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetStatus() (res CreateSnapshotPayloadGetStatusRetType) { - 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 *CreateSnapshotPayload) GetStatusOk() (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { - return getCreateSnapshotPayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateSnapshotPayload) SetStatus(v CreateSnapshotPayloadGetStatusRetType) { - setCreateSnapshotPayloadGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetUpdatedAt() (res CreateSnapshotPayloadGetUpdatedAtRetType) { - 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 *CreateSnapshotPayload) GetUpdatedAtOk() (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { - return getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetUpdatedAt(v CreateSnapshotPayloadGetUpdatedAtRetType) { - setCreateSnapshotPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetVolumeId returns the VolumeId field value -func (o *CreateSnapshotPayload) GetVolumeId() (ret CreateSnapshotPayloadGetVolumeIdRetType) { - ret, _ = o.GetVolumeIdOk() - return ret -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value -// and a boolean to check if the value has been set. -func (o *CreateSnapshotPayload) GetVolumeIdOk() (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { - return getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// SetVolumeId sets field value -func (o *CreateSnapshotPayload) SetVolumeId(v CreateSnapshotPayloadGetVolumeIdRetType) { - setCreateSnapshotPayloadGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateSnapshotPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateSnapshotPayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getCreateSnapshotPayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableCreateSnapshotPayload struct { - value *CreateSnapshotPayload - isSet bool -} - -func (v NullableCreateSnapshotPayload) Get() *CreateSnapshotPayload { - return v.value -} - -func (v *NullableCreateSnapshotPayload) Set(val *CreateSnapshotPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSnapshotPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSnapshotPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSnapshotPayload(val *CreateSnapshotPayload) *NullableCreateSnapshotPayload { - return &NullableCreateSnapshotPayload{value: val, isSet: true} -} - -func (v NullableCreateSnapshotPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSnapshotPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_snapshot_payload_test.go b/services/iaasalpha/model_create_snapshot_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_snapshot_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_virtual_ip_payload.go b/services/iaasalpha/model_create_virtual_ip_payload.go deleted file mode 100644 index ab954c20b..000000000 --- a/services/iaasalpha/model_create_virtual_ip_payload.go +++ /dev/null @@ -1,421 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateVirtualIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateVirtualIPPayload{} - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateVirtualIPPayloadGetIdAttributeType = *string - -func getCreateVirtualIPPayloadGetIdAttributeTypeOk(arg CreateVirtualIPPayloadGetIdAttributeType) (ret CreateVirtualIPPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetIdAttributeType(arg *CreateVirtualIPPayloadGetIdAttributeType, val CreateVirtualIPPayloadGetIdRetType) { - *arg = &val -} - -type CreateVirtualIPPayloadGetIdArgType = string -type CreateVirtualIPPayloadGetIdRetType = string - -/* - types and functions for ip -*/ - -// isNotNullableString -type CreateVirtualIPPayloadGetIpAttributeType = *string - -func getCreateVirtualIPPayloadGetIpAttributeTypeOk(arg CreateVirtualIPPayloadGetIpAttributeType) (ret CreateVirtualIPPayloadGetIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetIpAttributeType(arg *CreateVirtualIPPayloadGetIpAttributeType, val CreateVirtualIPPayloadGetIpRetType) { - *arg = &val -} - -type CreateVirtualIPPayloadGetIpArgType = string -type CreateVirtualIPPayloadGetIpRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type CreateVirtualIPPayloadGetLabelsAttributeType = *map[string]interface{} -type CreateVirtualIPPayloadGetLabelsArgType = map[string]interface{} -type CreateVirtualIPPayloadGetLabelsRetType = map[string]interface{} - -func getCreateVirtualIPPayloadGetLabelsAttributeTypeOk(arg CreateVirtualIPPayloadGetLabelsAttributeType) (ret CreateVirtualIPPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetLabelsAttributeType(arg *CreateVirtualIPPayloadGetLabelsAttributeType, val CreateVirtualIPPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for members -*/ - -// isArray -type CreateVirtualIPPayloadGetMembersAttributeType = *[]string -type CreateVirtualIPPayloadGetMembersArgType = []string -type CreateVirtualIPPayloadGetMembersRetType = []string - -func getCreateVirtualIPPayloadGetMembersAttributeTypeOk(arg CreateVirtualIPPayloadGetMembersAttributeType) (ret CreateVirtualIPPayloadGetMembersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetMembersAttributeType(arg *CreateVirtualIPPayloadGetMembersAttributeType, val CreateVirtualIPPayloadGetMembersRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateVirtualIPPayloadGetNameAttributeType = *string - -func getCreateVirtualIPPayloadGetNameAttributeTypeOk(arg CreateVirtualIPPayloadGetNameAttributeType) (ret CreateVirtualIPPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetNameAttributeType(arg *CreateVirtualIPPayloadGetNameAttributeType, val CreateVirtualIPPayloadGetNameRetType) { - *arg = &val -} - -type CreateVirtualIPPayloadGetNameArgType = string -type CreateVirtualIPPayloadGetNameRetType = string - -/* - types and functions for network -*/ - -// isNotNullableString -type CreateVirtualIPPayloadGetNetworkAttributeType = *string - -func getCreateVirtualIPPayloadGetNetworkAttributeTypeOk(arg CreateVirtualIPPayloadGetNetworkAttributeType) (ret CreateVirtualIPPayloadGetNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetNetworkAttributeType(arg *CreateVirtualIPPayloadGetNetworkAttributeType, val CreateVirtualIPPayloadGetNetworkRetType) { - *arg = &val -} - -type CreateVirtualIPPayloadGetNetworkArgType = string -type CreateVirtualIPPayloadGetNetworkRetType = string - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateVirtualIPPayloadGetStatusAttributeType = *string - -func getCreateVirtualIPPayloadGetStatusAttributeTypeOk(arg CreateVirtualIPPayloadGetStatusAttributeType) (ret CreateVirtualIPPayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVirtualIPPayloadGetStatusAttributeType(arg *CreateVirtualIPPayloadGetStatusAttributeType, val CreateVirtualIPPayloadGetStatusRetType) { - *arg = &val -} - -type CreateVirtualIPPayloadGetStatusArgType = string -type CreateVirtualIPPayloadGetStatusRetType = string - -// CreateVirtualIPPayload Object that represents a virtual IP. -type CreateVirtualIPPayload struct { - // Universally Unique Identifier (UUID). - Id CreateVirtualIPPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ip CreateVirtualIPPayloadGetIpAttributeType `json:"ip,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateVirtualIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // A list of UUIDs. - Members CreateVirtualIPPayloadGetMembersAttributeType `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name CreateVirtualIPPayloadGetNameAttributeType `json:"name,omitempty"` - // Universally Unique Identifier (UUID). - Network CreateVirtualIPPayloadGetNetworkAttributeType `json:"network,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status CreateVirtualIPPayloadGetStatusAttributeType `json:"status,omitempty"` -} - -// NewCreateVirtualIPPayload instantiates a new CreateVirtualIPPayload 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 NewCreateVirtualIPPayload() *CreateVirtualIPPayload { - this := CreateVirtualIPPayload{} - return &this -} - -// NewCreateVirtualIPPayloadWithDefaults instantiates a new CreateVirtualIPPayload 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 NewCreateVirtualIPPayloadWithDefaults() *CreateVirtualIPPayload { - this := CreateVirtualIPPayload{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetId() (res CreateVirtualIPPayloadGetIdRetType) { - 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 *CreateVirtualIPPayload) GetIdOk() (ret CreateVirtualIPPayloadGetIdRetType, ok bool) { - return getCreateVirtualIPPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateVirtualIPPayload) SetId(v CreateVirtualIPPayloadGetIdRetType) { - setCreateVirtualIPPayloadGetIdAttributeType(&o.Id, v) -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetIp() (res CreateVirtualIPPayloadGetIpRetType) { - res, _ = o.GetIpOk() - return -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVirtualIPPayload) GetIpOk() (ret CreateVirtualIPPayloadGetIpRetType, ok bool) { - return getCreateVirtualIPPayloadGetIpAttributeTypeOk(o.Ip) -} - -// HasIp returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasIp() bool { - _, ok := o.GetIpOk() - return ok -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *CreateVirtualIPPayload) SetIp(v CreateVirtualIPPayloadGetIpRetType) { - setCreateVirtualIPPayloadGetIpAttributeType(&o.Ip, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetLabels() (res CreateVirtualIPPayloadGetLabelsRetType) { - 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 *CreateVirtualIPPayload) GetLabelsOk() (ret CreateVirtualIPPayloadGetLabelsRetType, ok bool) { - return getCreateVirtualIPPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) 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 *CreateVirtualIPPayload) SetLabels(v CreateVirtualIPPayloadGetLabelsRetType) { - setCreateVirtualIPPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetMembers() (res CreateVirtualIPPayloadGetMembersRetType) { - res, _ = o.GetMembersOk() - return -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVirtualIPPayload) GetMembersOk() (ret CreateVirtualIPPayloadGetMembersRetType, ok bool) { - return getCreateVirtualIPPayloadGetMembersAttributeTypeOk(o.Members) -} - -// HasMembers returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasMembers() bool { - _, ok := o.GetMembersOk() - return ok -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *CreateVirtualIPPayload) SetMembers(v CreateVirtualIPPayloadGetMembersRetType) { - setCreateVirtualIPPayloadGetMembersAttributeType(&o.Members, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetName() (res CreateVirtualIPPayloadGetNameRetType) { - 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 *CreateVirtualIPPayload) GetNameOk() (ret CreateVirtualIPPayloadGetNameRetType, ok bool) { - return getCreateVirtualIPPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateVirtualIPPayload) SetName(v CreateVirtualIPPayloadGetNameRetType) { - setCreateVirtualIPPayloadGetNameAttributeType(&o.Name, v) -} - -// GetNetwork returns the Network field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetNetwork() (res CreateVirtualIPPayloadGetNetworkRetType) { - res, _ = o.GetNetworkOk() - return -} - -// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVirtualIPPayload) GetNetworkOk() (ret CreateVirtualIPPayloadGetNetworkRetType, ok bool) { - return getCreateVirtualIPPayloadGetNetworkAttributeTypeOk(o.Network) -} - -// HasNetwork returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasNetwork() bool { - _, ok := o.GetNetworkOk() - return ok -} - -// SetNetwork gets a reference to the given string and assigns it to the Network field. -func (o *CreateVirtualIPPayload) SetNetwork(v CreateVirtualIPPayloadGetNetworkRetType) { - setCreateVirtualIPPayloadGetNetworkAttributeType(&o.Network, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateVirtualIPPayload) GetStatus() (res CreateVirtualIPPayloadGetStatusRetType) { - 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 *CreateVirtualIPPayload) GetStatusOk() (ret CreateVirtualIPPayloadGetStatusRetType, ok bool) { - return getCreateVirtualIPPayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateVirtualIPPayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateVirtualIPPayload) SetStatus(v CreateVirtualIPPayloadGetStatusRetType) { - setCreateVirtualIPPayloadGetStatusAttributeType(&o.Status, v) -} - -func (o CreateVirtualIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateVirtualIPPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateVirtualIPPayloadGetIpAttributeTypeOk(o.Ip); ok { - toSerialize["Ip"] = val - } - if val, ok := getCreateVirtualIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateVirtualIPPayloadGetMembersAttributeTypeOk(o.Members); ok { - toSerialize["Members"] = val - } - if val, ok := getCreateVirtualIPPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateVirtualIPPayloadGetNetworkAttributeTypeOk(o.Network); ok { - toSerialize["Network"] = val - } - if val, ok := getCreateVirtualIPPayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - return toSerialize, nil -} - -type NullableCreateVirtualIPPayload struct { - value *CreateVirtualIPPayload - isSet bool -} - -func (v NullableCreateVirtualIPPayload) Get() *CreateVirtualIPPayload { - return v.value -} - -func (v *NullableCreateVirtualIPPayload) Set(val *CreateVirtualIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateVirtualIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateVirtualIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateVirtualIPPayload(val *CreateVirtualIPPayload) *NullableCreateVirtualIPPayload { - return &NullableCreateVirtualIPPayload{value: val, isSet: true} -} - -func (v NullableCreateVirtualIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateVirtualIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_virtual_ip_payload_test.go b/services/iaasalpha/model_create_virtual_ip_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_virtual_ip_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_create_volume_payload.go b/services/iaasalpha/model_create_volume_payload.go deleted file mode 100644 index 2ddae2125..000000000 --- a/services/iaasalpha/model_create_volume_payload.go +++ /dev/null @@ -1,756 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the CreateVolumePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateVolumePayload{} - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type CreateVolumePayloadGetAvailabilityZoneAttributeType = *string - -func getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(arg CreateVolumePayloadGetAvailabilityZoneAttributeType) (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetAvailabilityZoneAttributeType(arg *CreateVolumePayloadGetAvailabilityZoneAttributeType, val CreateVolumePayloadGetAvailabilityZoneRetType) { - *arg = &val -} - -type CreateVolumePayloadGetAvailabilityZoneArgType = string -type CreateVolumePayloadGetAvailabilityZoneRetType = string - -/* - types and functions for bootable -*/ - -// isBoolean -type CreateVolumePayloadgetBootableAttributeType = *bool -type CreateVolumePayloadgetBootableArgType = bool -type CreateVolumePayloadgetBootableRetType = bool - -func getCreateVolumePayloadgetBootableAttributeTypeOk(arg CreateVolumePayloadgetBootableAttributeType) (ret CreateVolumePayloadgetBootableRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadgetBootableAttributeType(arg *CreateVolumePayloadgetBootableAttributeType, val CreateVolumePayloadgetBootableRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type CreateVolumePayloadGetCreatedAtAttributeType = *time.Time -type CreateVolumePayloadGetCreatedAtArgType = time.Time -type CreateVolumePayloadGetCreatedAtRetType = time.Time - -func getCreateVolumePayloadGetCreatedAtAttributeTypeOk(arg CreateVolumePayloadGetCreatedAtAttributeType) (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetCreatedAtAttributeType(arg *CreateVolumePayloadGetCreatedAtAttributeType, val CreateVolumePayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -type CreateVolumePayloadGetDescriptionAttributeType = *string - -func getCreateVolumePayloadGetDescriptionAttributeTypeOk(arg CreateVolumePayloadGetDescriptionAttributeType) (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetDescriptionAttributeType(arg *CreateVolumePayloadGetDescriptionAttributeType, val CreateVolumePayloadGetDescriptionRetType) { - *arg = &val -} - -type CreateVolumePayloadGetDescriptionArgType = string -type CreateVolumePayloadGetDescriptionRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type CreateVolumePayloadGetIdAttributeType = *string - -func getCreateVolumePayloadGetIdAttributeTypeOk(arg CreateVolumePayloadGetIdAttributeType) (ret CreateVolumePayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetIdAttributeType(arg *CreateVolumePayloadGetIdAttributeType, val CreateVolumePayloadGetIdRetType) { - *arg = &val -} - -type CreateVolumePayloadGetIdArgType = string -type CreateVolumePayloadGetIdRetType = string - -/* - types and functions for imageConfig -*/ - -// isModel -type CreateVolumePayloadGetImageConfigAttributeType = *ImageConfig -type CreateVolumePayloadGetImageConfigArgType = ImageConfig -type CreateVolumePayloadGetImageConfigRetType = ImageConfig - -func getCreateVolumePayloadGetImageConfigAttributeTypeOk(arg CreateVolumePayloadGetImageConfigAttributeType) (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetImageConfigAttributeType(arg *CreateVolumePayloadGetImageConfigAttributeType, val CreateVolumePayloadGetImageConfigRetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type CreateVolumePayloadGetLabelsAttributeType = *map[string]interface{} -type CreateVolumePayloadGetLabelsArgType = map[string]interface{} -type CreateVolumePayloadGetLabelsRetType = map[string]interface{} - -func getCreateVolumePayloadGetLabelsAttributeTypeOk(arg CreateVolumePayloadGetLabelsAttributeType) (ret CreateVolumePayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetLabelsAttributeType(arg *CreateVolumePayloadGetLabelsAttributeType, val CreateVolumePayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type CreateVolumePayloadGetNameAttributeType = *string - -func getCreateVolumePayloadGetNameAttributeTypeOk(arg CreateVolumePayloadGetNameAttributeType) (ret CreateVolumePayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetNameAttributeType(arg *CreateVolumePayloadGetNameAttributeType, val CreateVolumePayloadGetNameRetType) { - *arg = &val -} - -type CreateVolumePayloadGetNameArgType = string -type CreateVolumePayloadGetNameRetType = string - -/* - types and functions for performanceClass -*/ - -// isNotNullableString -type CreateVolumePayloadGetPerformanceClassAttributeType = *string - -func getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(arg CreateVolumePayloadGetPerformanceClassAttributeType) (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetPerformanceClassAttributeType(arg *CreateVolumePayloadGetPerformanceClassAttributeType, val CreateVolumePayloadGetPerformanceClassRetType) { - *arg = &val -} - -type CreateVolumePayloadGetPerformanceClassArgType = string -type CreateVolumePayloadGetPerformanceClassRetType = string - -/* - types and functions for serverId -*/ - -// isNotNullableString -type CreateVolumePayloadGetServerIdAttributeType = *string - -func getCreateVolumePayloadGetServerIdAttributeTypeOk(arg CreateVolumePayloadGetServerIdAttributeType) (ret CreateVolumePayloadGetServerIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetServerIdAttributeType(arg *CreateVolumePayloadGetServerIdAttributeType, val CreateVolumePayloadGetServerIdRetType) { - *arg = &val -} - -type CreateVolumePayloadGetServerIdArgType = string -type CreateVolumePayloadGetServerIdRetType = string - -/* - types and functions for size -*/ - -// isLong -type CreateVolumePayloadGetSizeAttributeType = *int64 -type CreateVolumePayloadGetSizeArgType = int64 -type CreateVolumePayloadGetSizeRetType = int64 - -func getCreateVolumePayloadGetSizeAttributeTypeOk(arg CreateVolumePayloadGetSizeAttributeType) (ret CreateVolumePayloadGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetSizeAttributeType(arg *CreateVolumePayloadGetSizeAttributeType, val CreateVolumePayloadGetSizeRetType) { - *arg = &val -} - -/* - types and functions for source -*/ - -// isModel -type CreateVolumePayloadGetSourceAttributeType = *VolumeSource -type CreateVolumePayloadGetSourceArgType = VolumeSource -type CreateVolumePayloadGetSourceRetType = VolumeSource - -func getCreateVolumePayloadGetSourceAttributeTypeOk(arg CreateVolumePayloadGetSourceAttributeType) (ret CreateVolumePayloadGetSourceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetSourceAttributeType(arg *CreateVolumePayloadGetSourceAttributeType, val CreateVolumePayloadGetSourceRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type CreateVolumePayloadGetStatusAttributeType = *string - -func getCreateVolumePayloadGetStatusAttributeTypeOk(arg CreateVolumePayloadGetStatusAttributeType) (ret CreateVolumePayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetStatusAttributeType(arg *CreateVolumePayloadGetStatusAttributeType, val CreateVolumePayloadGetStatusRetType) { - *arg = &val -} - -type CreateVolumePayloadGetStatusArgType = string -type CreateVolumePayloadGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type CreateVolumePayloadGetUpdatedAtAttributeType = *time.Time -type CreateVolumePayloadGetUpdatedAtArgType = time.Time -type CreateVolumePayloadGetUpdatedAtRetType = time.Time - -func getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(arg CreateVolumePayloadGetUpdatedAtAttributeType) (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateVolumePayloadGetUpdatedAtAttributeType(arg *CreateVolumePayloadGetUpdatedAtAttributeType, val CreateVolumePayloadGetUpdatedAtRetType) { - *arg = &val -} - -// CreateVolumePayload Object that represents a volume and its parameters. Used for Creating and returning (get/list). -type CreateVolumePayload struct { - // Object that represents an availability zone. - // REQUIRED - AvailabilityZone CreateVolumePayloadGetAvailabilityZoneAttributeType `json:"availabilityZone" required:"true"` - // Indicates if a volume is bootable. - Bootable CreateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` - // Date-time when resource was created. - CreatedAt CreateVolumePayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description CreateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id CreateVolumePayloadGetIdAttributeType `json:"id,omitempty"` - ImageConfig CreateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels CreateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name CreateVolumePayloadGetNameAttributeType `json:"name,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass CreateVolumePayloadGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` - // Universally Unique Identifier (UUID). - ServerId CreateVolumePayloadGetServerIdAttributeType `json:"serverId,omitempty"` - // Size in Gigabyte. - Size CreateVolumePayloadGetSizeAttributeType `json:"size,omitempty"` - Source CreateVolumePayloadGetSourceAttributeType `json:"source,omitempty"` - // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. - Status CreateVolumePayloadGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt CreateVolumePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _CreateVolumePayload CreateVolumePayload - -// NewCreateVolumePayload instantiates a new CreateVolumePayload 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 NewCreateVolumePayload(availabilityZone CreateVolumePayloadGetAvailabilityZoneArgType) *CreateVolumePayload { - this := CreateVolumePayload{} - setCreateVolumePayloadGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) - return &this -} - -// NewCreateVolumePayloadWithDefaults instantiates a new CreateVolumePayload 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 NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { - this := CreateVolumePayload{} - return &this -} - -// GetAvailabilityZone returns the AvailabilityZone field value -func (o *CreateVolumePayload) GetAvailabilityZone() (ret CreateVolumePayloadGetAvailabilityZoneRetType) { - ret, _ = o.GetAvailabilityZoneOk() - return ret -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value -// and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetAvailabilityZoneOk() (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { - return getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// SetAvailabilityZone sets field value -func (o *CreateVolumePayload) SetAvailabilityZone(v CreateVolumePayloadGetAvailabilityZoneRetType) { - setCreateVolumePayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetBootable() (res CreateVolumePayloadgetBootableRetType) { - res, _ = o.GetBootableOk() - return -} - -// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetBootableOk() (ret CreateVolumePayloadgetBootableRetType, ok bool) { - return getCreateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) -} - -// HasBootable returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasBootable() bool { - _, ok := o.GetBootableOk() - return ok -} - -// SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *CreateVolumePayload) SetBootable(v CreateVolumePayloadgetBootableRetType) { - setCreateVolumePayloadgetBootableAttributeType(&o.Bootable, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetCreatedAt() (res CreateVolumePayloadGetCreatedAtRetType) { - 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 *CreateVolumePayload) GetCreatedAtOk() (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { - return getCreateVolumePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetCreatedAt(v CreateVolumePayloadGetCreatedAtRetType) { - setCreateVolumePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetDescription() (res CreateVolumePayloadGetDescriptionRetType) { - 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 *CreateVolumePayload) GetDescriptionOk() (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { - return getCreateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreateVolumePayload) SetDescription(v CreateVolumePayloadGetDescriptionRetType) { - setCreateVolumePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetId() (res CreateVolumePayloadGetIdRetType) { - 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 *CreateVolumePayload) GetIdOk() (ret CreateVolumePayloadGetIdRetType, ok bool) { - return getCreateVolumePayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateVolumePayload) SetId(v CreateVolumePayloadGetIdRetType) { - setCreateVolumePayloadGetIdAttributeType(&o.Id, v) -} - -// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetImageConfig() (res CreateVolumePayloadGetImageConfigRetType) { - res, _ = o.GetImageConfigOk() - return -} - -// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetImageConfigOk() (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { - return getCreateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) -} - -// HasImageConfig returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasImageConfig() bool { - _, ok := o.GetImageConfigOk() - return ok -} - -// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *CreateVolumePayload) SetImageConfig(v CreateVolumePayloadGetImageConfigRetType) { - setCreateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetLabels() (res CreateVolumePayloadGetLabelsRetType) { - 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 *CreateVolumePayload) GetLabelsOk() (ret CreateVolumePayloadGetLabelsRetType, ok bool) { - return getCreateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetLabels(v CreateVolumePayloadGetLabelsRetType) { - setCreateVolumePayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetName() (res CreateVolumePayloadGetNameRetType) { - 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 *CreateVolumePayload) GetNameOk() (ret CreateVolumePayloadGetNameRetType, ok bool) { - return getCreateVolumePayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateVolumePayload) SetName(v CreateVolumePayloadGetNameRetType) { - setCreateVolumePayloadGetNameAttributeType(&o.Name, v) -} - -// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetPerformanceClass() (res CreateVolumePayloadGetPerformanceClassRetType) { - 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 *CreateVolumePayload) GetPerformanceClassOk() (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { - return getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass) -} - -// HasPerformanceClass returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasPerformanceClass() bool { - _, ok := o.GetPerformanceClassOk() - return ok -} - -// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *CreateVolumePayload) SetPerformanceClass(v CreateVolumePayloadGetPerformanceClassRetType) { - setCreateVolumePayloadGetPerformanceClassAttributeType(&o.PerformanceClass, v) -} - -// GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetServerId() (res CreateVolumePayloadGetServerIdRetType) { - res, _ = o.GetServerIdOk() - return -} - -// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetServerIdOk() (ret CreateVolumePayloadGetServerIdRetType, ok bool) { - return getCreateVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) -} - -// HasServerId returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasServerId() bool { - _, ok := o.GetServerIdOk() - return ok -} - -// SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *CreateVolumePayload) SetServerId(v CreateVolumePayloadGetServerIdRetType) { - setCreateVolumePayloadGetServerIdAttributeType(&o.ServerId, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetSize() (res CreateVolumePayloadGetSizeRetType) { - 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 *CreateVolumePayload) GetSizeOk() (ret CreateVolumePayloadGetSizeRetType, ok bool) { - return getCreateVolumePayloadGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *CreateVolumePayload) SetSize(v CreateVolumePayloadGetSizeRetType) { - setCreateVolumePayloadGetSizeAttributeType(&o.Size, v) -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetSource() (res CreateVolumePayloadGetSourceRetType) { - 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 *CreateVolumePayload) GetSourceOk() (ret CreateVolumePayloadGetSourceRetType, ok bool) { - return getCreateVolumePayloadGetSourceAttributeTypeOk(o.Source) -} - -// HasSource returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasSource() bool { - _, ok := o.GetSourceOk() - return ok -} - -// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. -func (o *CreateVolumePayload) SetSource(v CreateVolumePayloadGetSourceRetType) { - setCreateVolumePayloadGetSourceAttributeType(&o.Source, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetStatus() (res CreateVolumePayloadGetStatusRetType) { - 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 *CreateVolumePayload) GetStatusOk() (ret CreateVolumePayloadGetStatusRetType, ok bool) { - return getCreateVolumePayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateVolumePayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateVolumePayload) SetStatus(v CreateVolumePayloadGetStatusRetType) { - setCreateVolumePayloadGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetUpdatedAt() (res CreateVolumePayloadGetUpdatedAtRetType) { - 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 *CreateVolumePayload) GetUpdatedAtOk() (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { - return getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetUpdatedAt(v CreateVolumePayloadGetUpdatedAtRetType) { - setCreateVolumePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getCreateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { - toSerialize["Bootable"] = val - } - if val, ok := getCreateVolumePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getCreateVolumePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateVolumePayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getCreateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig); ok { - toSerialize["ImageConfig"] = val - } - if val, ok := getCreateVolumePayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateVolumePayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { - toSerialize["PerformanceClass"] = val - } - if val, ok := getCreateVolumePayloadGetServerIdAttributeTypeOk(o.ServerId); ok { - toSerialize["ServerId"] = val - } - if val, ok := getCreateVolumePayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getCreateVolumePayloadGetSourceAttributeTypeOk(o.Source); ok { - toSerialize["Source"] = val - } - if val, ok := getCreateVolumePayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableCreateVolumePayload struct { - value *CreateVolumePayload - isSet bool -} - -func (v NullableCreateVolumePayload) Get() *CreateVolumePayload { - return v.value -} - -func (v *NullableCreateVolumePayload) Set(val *CreateVolumePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateVolumePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateVolumePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateVolumePayload(val *CreateVolumePayload) *NullableCreateVolumePayload { - return &NullableCreateVolumePayload{value: val, isSet: true} -} - -func (v NullableCreateVolumePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateVolumePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_volume_payload_test.go b/services/iaasalpha/model_create_volume_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_create_volume_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_destination_cidrv4.go b/services/iaasalpha/model_destination_cidrv4.go new file mode 100644 index 000000000..b89a42e76 --- /dev/null +++ b/services/iaasalpha/model_destination_cidrv4.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_destination_cidrv4_test.go b/services/iaasalpha/model_destination_cidrv4_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_destination_cidrv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_destination_cidrv6.go b/services/iaasalpha/model_destination_cidrv6.go new file mode 100644 index 000000000..6f210dc62 --- /dev/null +++ b/services/iaasalpha/model_destination_cidrv6.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_destination_cidrv6_test.go b/services/iaasalpha/model_destination_cidrv6_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_destination_cidrv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_error.go b/services/iaasalpha/model_error.go index df833781d..09350af9e 100644 --- a/services/iaasalpha/model_error.go +++ b/services/iaasalpha/model_error.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_error_test.go b/services/iaasalpha/model_error_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_error_test.go +++ b/services/iaasalpha/model_error_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_get_server_log_200_response.go b/services/iaasalpha/model_get_server_log_200_response.go deleted file mode 100644 index 44362ccc2..000000000 --- a/services/iaasalpha/model_get_server_log_200_response.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the GetServerLog200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetServerLog200Response{} - -/* - types and functions for output -*/ - -// isNotNullableString -type GetServerLog200ResponseGetOutputAttributeType = *string - -func getGetServerLog200ResponseGetOutputAttributeTypeOk(arg GetServerLog200ResponseGetOutputAttributeType) (ret GetServerLog200ResponseGetOutputRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setGetServerLog200ResponseGetOutputAttributeType(arg *GetServerLog200ResponseGetOutputAttributeType, val GetServerLog200ResponseGetOutputRetType) { - *arg = &val -} - -type GetServerLog200ResponseGetOutputArgType = string -type GetServerLog200ResponseGetOutputRetType = string - -// GetServerLog200Response struct for GetServerLog200Response -type GetServerLog200Response struct { - Output GetServerLog200ResponseGetOutputAttributeType `json:"output,omitempty"` -} - -// NewGetServerLog200Response instantiates a new GetServerLog200Response 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 NewGetServerLog200Response() *GetServerLog200Response { - this := GetServerLog200Response{} - return &this -} - -// NewGetServerLog200ResponseWithDefaults instantiates a new GetServerLog200Response 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 NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { - this := GetServerLog200Response{} - return &this -} - -// GetOutput returns the Output field value if set, zero value otherwise. -func (o *GetServerLog200Response) GetOutput() (res GetServerLog200ResponseGetOutputRetType) { - res, _ = o.GetOutputOk() - return -} - -// GetOutputOk returns a tuple with the Output field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetServerLog200Response) GetOutputOk() (ret GetServerLog200ResponseGetOutputRetType, ok bool) { - return getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output) -} - -// HasOutput returns a boolean if a field has been set. -func (o *GetServerLog200Response) HasOutput() bool { - _, ok := o.GetOutputOk() - return ok -} - -// SetOutput gets a reference to the given string and assigns it to the Output field. -func (o *GetServerLog200Response) SetOutput(v GetServerLog200ResponseGetOutputRetType) { - setGetServerLog200ResponseGetOutputAttributeType(&o.Output, v) -} - -func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output); ok { - toSerialize["Output"] = val - } - return toSerialize, nil -} - -type NullableGetServerLog200Response struct { - value *GetServerLog200Response - isSet bool -} - -func (v NullableGetServerLog200Response) Get() *GetServerLog200Response { - return v.value -} - -func (v *NullableGetServerLog200Response) Set(val *GetServerLog200Response) { - v.value = val - v.isSet = true -} - -func (v NullableGetServerLog200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableGetServerLog200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetServerLog200Response(val *GetServerLog200Response) *NullableGetServerLog200Response { - return &NullableGetServerLog200Response{value: val, isSet: true} -} - -func (v NullableGetServerLog200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetServerLog200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_get_server_log_200_response_test.go b/services/iaasalpha/model_get_server_log_200_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_get_server_log_200_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_icmp_parameters.go b/services/iaasalpha/model_icmp_parameters.go deleted file mode 100644 index 892657261..000000000 --- a/services/iaasalpha/model_icmp_parameters.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ICMPParameters type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ICMPParameters{} - -/* - types and functions for code -*/ - -// isLong -type ICMPParametersGetCodeAttributeType = *int64 -type ICMPParametersGetCodeArgType = int64 -type ICMPParametersGetCodeRetType = int64 - -func getICMPParametersGetCodeAttributeTypeOk(arg ICMPParametersGetCodeAttributeType) (ret ICMPParametersGetCodeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setICMPParametersGetCodeAttributeType(arg *ICMPParametersGetCodeAttributeType, val ICMPParametersGetCodeRetType) { - *arg = &val -} - -/* - types and functions for type -*/ - -// isLong -type ICMPParametersGetTypeAttributeType = *int64 -type ICMPParametersGetTypeArgType = int64 -type ICMPParametersGetTypeRetType = int64 - -func getICMPParametersGetTypeAttributeTypeOk(arg ICMPParametersGetTypeAttributeType) (ret ICMPParametersGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setICMPParametersGetTypeAttributeType(arg *ICMPParametersGetTypeAttributeType, val ICMPParametersGetTypeRetType) { - *arg = &val -} - -// ICMPParameters Object that represents ICMP parameters. -type ICMPParameters struct { - // ICMP code. Can be set if the protocol is ICMP. - // REQUIRED - Code ICMPParametersGetCodeAttributeType `json:"code" required:"true"` - // ICMP type. Can be set if the protocol is ICMP. - // REQUIRED - Type ICMPParametersGetTypeAttributeType `json:"type" required:"true"` -} - -type _ICMPParameters ICMPParameters - -// NewICMPParameters instantiates a new ICMPParameters 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 NewICMPParameters(code ICMPParametersGetCodeArgType, types ICMPParametersGetTypeArgType) *ICMPParameters { - this := ICMPParameters{} - setICMPParametersGetCodeAttributeType(&this.Code, code) - setICMPParametersGetTypeAttributeType(&this.Type, types) - return &this -} - -// NewICMPParametersWithDefaults instantiates a new ICMPParameters 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 NewICMPParametersWithDefaults() *ICMPParameters { - this := ICMPParameters{} - return &this -} - -// GetCode returns the Code field value -func (o *ICMPParameters) GetCode() (ret ICMPParametersGetCodeRetType) { - ret, _ = o.GetCodeOk() - return ret -} - -// GetCodeOk returns a tuple with the Code field value -// and a boolean to check if the value has been set. -func (o *ICMPParameters) GetCodeOk() (ret ICMPParametersGetCodeRetType, ok bool) { - return getICMPParametersGetCodeAttributeTypeOk(o.Code) -} - -// SetCode sets field value -func (o *ICMPParameters) SetCode(v ICMPParametersGetCodeRetType) { - setICMPParametersGetCodeAttributeType(&o.Code, v) -} - -// GetType returns the Type field value -func (o *ICMPParameters) GetType() (ret ICMPParametersGetTypeRetType) { - 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 *ICMPParameters) GetTypeOk() (ret ICMPParametersGetTypeRetType, ok bool) { - return getICMPParametersGetTypeAttributeTypeOk(o.Type) -} - -// SetType sets field value -func (o *ICMPParameters) SetType(v ICMPParametersGetTypeRetType) { - setICMPParametersGetTypeAttributeType(&o.Type, v) -} - -func (o ICMPParameters) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getICMPParametersGetCodeAttributeTypeOk(o.Code); ok { - toSerialize["Code"] = val - } - if val, ok := getICMPParametersGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableICMPParameters struct { - value *ICMPParameters - isSet bool -} - -func (v NullableICMPParameters) Get() *ICMPParameters { - return v.value -} - -func (v *NullableICMPParameters) Set(val *ICMPParameters) { - v.value = val - v.isSet = true -} - -func (v NullableICMPParameters) IsSet() bool { - return v.isSet -} - -func (v *NullableICMPParameters) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableICMPParameters(val *ICMPParameters) *NullableICMPParameters { - return &NullableICMPParameters{value: val, isSet: true} -} - -func (v NullableICMPParameters) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableICMPParameters) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_icmp_parameters_test.go b/services/iaasalpha/model_icmp_parameters_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_icmp_parameters_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image.go b/services/iaasalpha/model_image.go deleted file mode 100644 index 240e9d84f..000000000 --- a/services/iaasalpha/model_image.go +++ /dev/null @@ -1,798 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Image type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Image{} - -/* - types and functions for checksum -*/ - -// isModel -type ImageGetChecksumAttributeType = *ImageChecksum -type ImageGetChecksumArgType = ImageChecksum -type ImageGetChecksumRetType = ImageChecksum - -func getImageGetChecksumAttributeTypeOk(arg ImageGetChecksumAttributeType) (ret ImageGetChecksumRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetChecksumAttributeType(arg *ImageGetChecksumAttributeType, val ImageGetChecksumRetType) { - *arg = &val -} - -/* - types and functions for config -*/ - -// isModel -type ImageGetConfigAttributeType = *ImageConfig -type ImageGetConfigArgType = ImageConfig -type ImageGetConfigRetType = ImageConfig - -func getImageGetConfigAttributeTypeOk(arg ImageGetConfigAttributeType) (ret ImageGetConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetConfigAttributeType(arg *ImageGetConfigAttributeType, val ImageGetConfigRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type ImageGetCreatedAtAttributeType = *time.Time -type ImageGetCreatedAtArgType = time.Time -type ImageGetCreatedAtRetType = time.Time - -func getImageGetCreatedAtAttributeTypeOk(arg ImageGetCreatedAtAttributeType) (ret ImageGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetCreatedAtAttributeType(arg *ImageGetCreatedAtAttributeType, val ImageGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for diskFormat -*/ - -// isNotNullableString -type ImageGetDiskFormatAttributeType = *string - -func getImageGetDiskFormatAttributeTypeOk(arg ImageGetDiskFormatAttributeType) (ret ImageGetDiskFormatRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetDiskFormatAttributeType(arg *ImageGetDiskFormatAttributeType, val ImageGetDiskFormatRetType) { - *arg = &val -} - -type ImageGetDiskFormatArgType = string -type ImageGetDiskFormatRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type ImageGetIdAttributeType = *string - -func getImageGetIdAttributeTypeOk(arg ImageGetIdAttributeType) (ret ImageGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetIdAttributeType(arg *ImageGetIdAttributeType, val ImageGetIdRetType) { - *arg = &val -} - -type ImageGetIdArgType = string -type ImageGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type ImageGetLabelsAttributeType = *map[string]interface{} -type ImageGetLabelsArgType = map[string]interface{} -type ImageGetLabelsRetType = map[string]interface{} - -func getImageGetLabelsAttributeTypeOk(arg ImageGetLabelsAttributeType) (ret ImageGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetLabelsAttributeType(arg *ImageGetLabelsAttributeType, val ImageGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for minDiskSize -*/ - -// isLong -type ImageGetMinDiskSizeAttributeType = *int64 -type ImageGetMinDiskSizeArgType = int64 -type ImageGetMinDiskSizeRetType = int64 - -func getImageGetMinDiskSizeAttributeTypeOk(arg ImageGetMinDiskSizeAttributeType) (ret ImageGetMinDiskSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetMinDiskSizeAttributeType(arg *ImageGetMinDiskSizeAttributeType, val ImageGetMinDiskSizeRetType) { - *arg = &val -} - -/* - types and functions for minRam -*/ - -// isLong -type ImageGetMinRamAttributeType = *int64 -type ImageGetMinRamArgType = int64 -type ImageGetMinRamRetType = int64 - -func getImageGetMinRamAttributeTypeOk(arg ImageGetMinRamAttributeType) (ret ImageGetMinRamRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetMinRamAttributeType(arg *ImageGetMinRamAttributeType, val ImageGetMinRamRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type ImageGetNameAttributeType = *string - -func getImageGetNameAttributeTypeOk(arg ImageGetNameAttributeType) (ret ImageGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetNameAttributeType(arg *ImageGetNameAttributeType, val ImageGetNameRetType) { - *arg = &val -} - -type ImageGetNameArgType = string -type ImageGetNameRetType = string - -/* - types and functions for owner -*/ - -// isNotNullableString -type ImageGetOwnerAttributeType = *string - -func getImageGetOwnerAttributeTypeOk(arg ImageGetOwnerAttributeType) (ret ImageGetOwnerRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetOwnerAttributeType(arg *ImageGetOwnerAttributeType, val ImageGetOwnerRetType) { - *arg = &val -} - -type ImageGetOwnerArgType = string -type ImageGetOwnerRetType = string - -/* - types and functions for protected -*/ - -// isBoolean -type ImagegetProtectedAttributeType = *bool -type ImagegetProtectedArgType = bool -type ImagegetProtectedRetType = bool - -func getImagegetProtectedAttributeTypeOk(arg ImagegetProtectedAttributeType) (ret ImagegetProtectedRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImagegetProtectedAttributeType(arg *ImagegetProtectedAttributeType, val ImagegetProtectedRetType) { - *arg = &val -} - -/* - types and functions for scope -*/ - -// isNotNullableString -type ImageGetScopeAttributeType = *string - -func getImageGetScopeAttributeTypeOk(arg ImageGetScopeAttributeType) (ret ImageGetScopeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetScopeAttributeType(arg *ImageGetScopeAttributeType, val ImageGetScopeRetType) { - *arg = &val -} - -type ImageGetScopeArgType = string -type ImageGetScopeRetType = string - -/* - types and functions for size -*/ - -// isLong -type ImageGetSizeAttributeType = *int64 -type ImageGetSizeArgType = int64 -type ImageGetSizeRetType = int64 - -func getImageGetSizeAttributeTypeOk(arg ImageGetSizeAttributeType) (ret ImageGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetSizeAttributeType(arg *ImageGetSizeAttributeType, val ImageGetSizeRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type ImageGetStatusAttributeType = *string - -func getImageGetStatusAttributeTypeOk(arg ImageGetStatusAttributeType) (ret ImageGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetStatusAttributeType(arg *ImageGetStatusAttributeType, val ImageGetStatusRetType) { - *arg = &val -} - -type ImageGetStatusArgType = string -type ImageGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type ImageGetUpdatedAtAttributeType = *time.Time -type ImageGetUpdatedAtArgType = time.Time -type ImageGetUpdatedAtRetType = time.Time - -func getImageGetUpdatedAtAttributeTypeOk(arg ImageGetUpdatedAtAttributeType) (ret ImageGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageGetUpdatedAtAttributeType(arg *ImageGetUpdatedAtAttributeType, val ImageGetUpdatedAtRetType) { - *arg = &val -} - -// Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). -type Image struct { - Checksum ImageGetChecksumAttributeType `json:"checksum,omitempty"` - Config ImageGetConfigAttributeType `json:"config,omitempty"` - // Date-time when resource was created. - CreatedAt ImageGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. - // REQUIRED - DiskFormat ImageGetDiskFormatAttributeType `json:"diskFormat" required:"true"` - // Universally Unique Identifier (UUID). - Id ImageGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels ImageGetLabelsAttributeType `json:"labels,omitempty"` - // Size in Gigabyte. - MinDiskSize ImageGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` - // Size in Megabyte. - MinRam ImageGetMinRamAttributeType `json:"minRam,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name ImageGetNameAttributeType `json:"name" required:"true"` - // Universally Unique Identifier (UUID). - Owner ImageGetOwnerAttributeType `json:"owner,omitempty"` - Protected ImagegetProtectedAttributeType `json:"protected,omitempty"` - // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. - Scope ImageGetScopeAttributeType `json:"scope,omitempty"` - // Size in bytes. - Size ImageGetSizeAttributeType `json:"size,omitempty"` - // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. - Status ImageGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt ImageGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _Image Image - -// NewImage instantiates a new Image 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 NewImage(diskFormat ImageGetDiskFormatArgType, name ImageGetNameArgType) *Image { - this := Image{} - setImageGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) - setImageGetNameAttributeType(&this.Name, name) - return &this -} - -// NewImageWithDefaults instantiates a new Image 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 NewImageWithDefaults() *Image { - this := Image{} - return &this -} - -// GetChecksum returns the Checksum field value if set, zero value otherwise. -func (o *Image) GetChecksum() (res ImageGetChecksumRetType) { - res, _ = o.GetChecksumOk() - return -} - -// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetChecksumOk() (ret ImageGetChecksumRetType, ok bool) { - return getImageGetChecksumAttributeTypeOk(o.Checksum) -} - -// HasChecksum returns a boolean if a field has been set. -func (o *Image) HasChecksum() bool { - _, ok := o.GetChecksumOk() - return ok -} - -// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. -func (o *Image) SetChecksum(v ImageGetChecksumRetType) { - setImageGetChecksumAttributeType(&o.Checksum, v) -} - -// GetConfig returns the Config field value if set, zero value otherwise. -func (o *Image) GetConfig() (res ImageGetConfigRetType) { - res, _ = o.GetConfigOk() - return -} - -// GetConfigOk returns a tuple with the Config field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetConfigOk() (ret ImageGetConfigRetType, ok bool) { - return getImageGetConfigAttributeTypeOk(o.Config) -} - -// HasConfig returns a boolean if a field has been set. -func (o *Image) HasConfig() bool { - _, ok := o.GetConfigOk() - return ok -} - -// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *Image) SetConfig(v ImageGetConfigRetType) { - setImageGetConfigAttributeType(&o.Config, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Image) GetCreatedAt() (res ImageGetCreatedAtRetType) { - 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 *Image) GetCreatedAtOk() (ret ImageGetCreatedAtRetType, ok bool) { - return getImageGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Image) 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 *Image) SetCreatedAt(v ImageGetCreatedAtRetType) { - setImageGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDiskFormat returns the DiskFormat field value -func (o *Image) GetDiskFormat() (ret ImageGetDiskFormatRetType) { - ret, _ = o.GetDiskFormatOk() - return ret -} - -// GetDiskFormatOk returns a tuple with the DiskFormat field value -// and a boolean to check if the value has been set. -func (o *Image) GetDiskFormatOk() (ret ImageGetDiskFormatRetType, ok bool) { - return getImageGetDiskFormatAttributeTypeOk(o.DiskFormat) -} - -// SetDiskFormat sets field value -func (o *Image) SetDiskFormat(v ImageGetDiskFormatRetType) { - setImageGetDiskFormatAttributeType(&o.DiskFormat, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Image) GetId() (res ImageGetIdRetType) { - 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 *Image) GetIdOk() (ret ImageGetIdRetType, ok bool) { - return getImageGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *Image) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Image) SetId(v ImageGetIdRetType) { - setImageGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Image) GetLabels() (res ImageGetLabelsRetType) { - 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 *Image) GetLabelsOk() (ret ImageGetLabelsRetType, ok bool) { - return getImageGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Image) 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 *Image) SetLabels(v ImageGetLabelsRetType) { - setImageGetLabelsAttributeType(&o.Labels, v) -} - -// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *Image) GetMinDiskSize() (res ImageGetMinDiskSizeRetType) { - res, _ = o.GetMinDiskSizeOk() - return -} - -// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetMinDiskSizeOk() (ret ImageGetMinDiskSizeRetType, ok bool) { - return getImageGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) -} - -// HasMinDiskSize returns a boolean if a field has been set. -func (o *Image) HasMinDiskSize() bool { - _, ok := o.GetMinDiskSizeOk() - return ok -} - -// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *Image) SetMinDiskSize(v ImageGetMinDiskSizeRetType) { - setImageGetMinDiskSizeAttributeType(&o.MinDiskSize, v) -} - -// GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *Image) GetMinRam() (res ImageGetMinRamRetType) { - res, _ = o.GetMinRamOk() - return -} - -// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetMinRamOk() (ret ImageGetMinRamRetType, ok bool) { - return getImageGetMinRamAttributeTypeOk(o.MinRam) -} - -// HasMinRam returns a boolean if a field has been set. -func (o *Image) HasMinRam() bool { - _, ok := o.GetMinRamOk() - return ok -} - -// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *Image) SetMinRam(v ImageGetMinRamRetType) { - setImageGetMinRamAttributeType(&o.MinRam, v) -} - -// GetName returns the Name field value -func (o *Image) GetName() (ret ImageGetNameRetType) { - 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 *Image) GetNameOk() (ret ImageGetNameRetType, ok bool) { - return getImageGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *Image) SetName(v ImageGetNameRetType) { - setImageGetNameAttributeType(&o.Name, v) -} - -// GetOwner returns the Owner field value if set, zero value otherwise. -func (o *Image) GetOwner() (res ImageGetOwnerRetType) { - res, _ = o.GetOwnerOk() - return -} - -// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetOwnerOk() (ret ImageGetOwnerRetType, ok bool) { - return getImageGetOwnerAttributeTypeOk(o.Owner) -} - -// HasOwner returns a boolean if a field has been set. -func (o *Image) HasOwner() bool { - _, ok := o.GetOwnerOk() - return ok -} - -// SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *Image) SetOwner(v ImageGetOwnerRetType) { - setImageGetOwnerAttributeType(&o.Owner, v) -} - -// GetProtected returns the Protected field value if set, zero value otherwise. -func (o *Image) GetProtected() (res ImagegetProtectedRetType) { - res, _ = o.GetProtectedOk() - return -} - -// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetProtectedOk() (ret ImagegetProtectedRetType, ok bool) { - return getImagegetProtectedAttributeTypeOk(o.Protected) -} - -// HasProtected returns a boolean if a field has been set. -func (o *Image) HasProtected() bool { - _, ok := o.GetProtectedOk() - return ok -} - -// SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *Image) SetProtected(v ImagegetProtectedRetType) { - setImagegetProtectedAttributeType(&o.Protected, v) -} - -// GetScope returns the Scope field value if set, zero value otherwise. -func (o *Image) GetScope() (res ImageGetScopeRetType) { - res, _ = o.GetScopeOk() - return -} - -// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Image) GetScopeOk() (ret ImageGetScopeRetType, ok bool) { - return getImageGetScopeAttributeTypeOk(o.Scope) -} - -// HasScope returns a boolean if a field has been set. -func (o *Image) HasScope() bool { - _, ok := o.GetScopeOk() - return ok -} - -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *Image) SetScope(v ImageGetScopeRetType) { - setImageGetScopeAttributeType(&o.Scope, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *Image) GetSize() (res ImageGetSizeRetType) { - 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 *Image) GetSizeOk() (ret ImageGetSizeRetType, ok bool) { - return getImageGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *Image) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Image) SetSize(v ImageGetSizeRetType) { - setImageGetSizeAttributeType(&o.Size, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Image) GetStatus() (res ImageGetStatusRetType) { - 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 *Image) GetStatusOk() (ret ImageGetStatusRetType, ok bool) { - return getImageGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *Image) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Image) SetStatus(v ImageGetStatusRetType) { - setImageGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Image) GetUpdatedAt() (res ImageGetUpdatedAtRetType) { - 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 *Image) GetUpdatedAtOk() (ret ImageGetUpdatedAtRetType, ok bool) { - return getImageGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Image) 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 *Image) SetUpdatedAt(v ImageGetUpdatedAtRetType) { - setImageGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o Image) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageGetChecksumAttributeTypeOk(o.Checksum); ok { - toSerialize["Checksum"] = val - } - if val, ok := getImageGetConfigAttributeTypeOk(o.Config); ok { - toSerialize["Config"] = val - } - if val, ok := getImageGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getImageGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { - toSerialize["DiskFormat"] = val - } - if val, ok := getImageGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getImageGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getImageGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { - toSerialize["MinDiskSize"] = val - } - if val, ok := getImageGetMinRamAttributeTypeOk(o.MinRam); ok { - toSerialize["MinRam"] = val - } - if val, ok := getImageGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getImageGetOwnerAttributeTypeOk(o.Owner); ok { - toSerialize["Owner"] = val - } - if val, ok := getImagegetProtectedAttributeTypeOk(o.Protected); ok { - toSerialize["Protected"] = val - } - if val, ok := getImageGetScopeAttributeTypeOk(o.Scope); ok { - toSerialize["Scope"] = val - } - if val, ok := getImageGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getImageGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getImageGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableImage struct { - value *Image - isSet bool -} - -func (v NullableImage) Get() *Image { - return v.value -} - -func (v *NullableImage) Set(val *Image) { - v.value = val - v.isSet = true -} - -func (v NullableImage) IsSet() bool { - return v.isSet -} - -func (v *NullableImage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImage(val *Image) *NullableImage { - return &NullableImage{value: val, isSet: true} -} - -func (v NullableImage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_checksum.go b/services/iaasalpha/model_image_checksum.go deleted file mode 100644 index b7f4b02d9..000000000 --- a/services/iaasalpha/model_image_checksum.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ImageChecksum type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageChecksum{} - -/* - types and functions for algorithm -*/ - -// isNotNullableString -type ImageChecksumGetAlgorithmAttributeType = *string - -func getImageChecksumGetAlgorithmAttributeTypeOk(arg ImageChecksumGetAlgorithmAttributeType) (ret ImageChecksumGetAlgorithmRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageChecksumGetAlgorithmAttributeType(arg *ImageChecksumGetAlgorithmAttributeType, val ImageChecksumGetAlgorithmRetType) { - *arg = &val -} - -type ImageChecksumGetAlgorithmArgType = string -type ImageChecksumGetAlgorithmRetType = string - -/* - types and functions for digest -*/ - -// isNotNullableString -type ImageChecksumGetDigestAttributeType = *string - -func getImageChecksumGetDigestAttributeTypeOk(arg ImageChecksumGetDigestAttributeType) (ret ImageChecksumGetDigestRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageChecksumGetDigestAttributeType(arg *ImageChecksumGetDigestAttributeType, val ImageChecksumGetDigestRetType) { - *arg = &val -} - -type ImageChecksumGetDigestArgType = string -type ImageChecksumGetDigestRetType = string - -// ImageChecksum Representation of an image checksum. -type ImageChecksum struct { - // Algorithm for the checksum of the image data. - // REQUIRED - Algorithm ImageChecksumGetAlgorithmAttributeType `json:"algorithm" required:"true"` - // Hexdigest of the checksum of the image data. - // REQUIRED - Digest ImageChecksumGetDigestAttributeType `json:"digest" required:"true"` -} - -type _ImageChecksum ImageChecksum - -// NewImageChecksum instantiates a new ImageChecksum 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 NewImageChecksum(algorithm ImageChecksumGetAlgorithmArgType, digest ImageChecksumGetDigestArgType) *ImageChecksum { - this := ImageChecksum{} - setImageChecksumGetAlgorithmAttributeType(&this.Algorithm, algorithm) - setImageChecksumGetDigestAttributeType(&this.Digest, digest) - return &this -} - -// NewImageChecksumWithDefaults instantiates a new ImageChecksum 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 NewImageChecksumWithDefaults() *ImageChecksum { - this := ImageChecksum{} - return &this -} - -// GetAlgorithm returns the Algorithm field value -func (o *ImageChecksum) GetAlgorithm() (ret ImageChecksumGetAlgorithmRetType) { - ret, _ = o.GetAlgorithmOk() - return ret -} - -// GetAlgorithmOk returns a tuple with the Algorithm field value -// and a boolean to check if the value has been set. -func (o *ImageChecksum) GetAlgorithmOk() (ret ImageChecksumGetAlgorithmRetType, ok bool) { - return getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm) -} - -// SetAlgorithm sets field value -func (o *ImageChecksum) SetAlgorithm(v ImageChecksumGetAlgorithmRetType) { - setImageChecksumGetAlgorithmAttributeType(&o.Algorithm, v) -} - -// GetDigest returns the Digest field value -func (o *ImageChecksum) GetDigest() (ret ImageChecksumGetDigestRetType) { - ret, _ = o.GetDigestOk() - return ret -} - -// GetDigestOk returns a tuple with the Digest field value -// and a boolean to check if the value has been set. -func (o *ImageChecksum) GetDigestOk() (ret ImageChecksumGetDigestRetType, ok bool) { - return getImageChecksumGetDigestAttributeTypeOk(o.Digest) -} - -// SetDigest sets field value -func (o *ImageChecksum) SetDigest(v ImageChecksumGetDigestRetType) { - setImageChecksumGetDigestAttributeType(&o.Digest, v) -} - -func (o ImageChecksum) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm); ok { - toSerialize["Algorithm"] = val - } - if val, ok := getImageChecksumGetDigestAttributeTypeOk(o.Digest); ok { - toSerialize["Digest"] = val - } - return toSerialize, nil -} - -type NullableImageChecksum struct { - value *ImageChecksum - isSet bool -} - -func (v NullableImageChecksum) Get() *ImageChecksum { - return v.value -} - -func (v *NullableImageChecksum) Set(val *ImageChecksum) { - v.value = val - v.isSet = true -} - -func (v NullableImageChecksum) IsSet() bool { - return v.isSet -} - -func (v *NullableImageChecksum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { - return &NullableImageChecksum{value: val, isSet: true} -} - -func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_checksum_test.go b/services/iaasalpha/model_image_checksum_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_checksum_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_config.go b/services/iaasalpha/model_image_config.go deleted file mode 100644 index 84d1981fa..000000000 --- a/services/iaasalpha/model_image_config.go +++ /dev/null @@ -1,882 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ImageConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageConfig{} - -/* - types and functions for architecture -*/ - -// isNotNullableString -type ImageConfigGetArchitectureAttributeType = *string - -func getImageConfigGetArchitectureAttributeTypeOk(arg ImageConfigGetArchitectureAttributeType) (ret ImageConfigGetArchitectureRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfigGetArchitectureAttributeType(arg *ImageConfigGetArchitectureAttributeType, val ImageConfigGetArchitectureRetType) { - *arg = &val -} - -type ImageConfigGetArchitectureArgType = string -type ImageConfigGetArchitectureRetType = string - -/* - types and functions for bootMenu -*/ - -// isBoolean -type ImageConfiggetBootMenuAttributeType = *bool -type ImageConfiggetBootMenuArgType = bool -type ImageConfiggetBootMenuRetType = bool - -func getImageConfiggetBootMenuAttributeTypeOk(arg ImageConfiggetBootMenuAttributeType) (ret ImageConfiggetBootMenuRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfiggetBootMenuAttributeType(arg *ImageConfiggetBootMenuAttributeType, val ImageConfiggetBootMenuRetType) { - *arg = &val -} - -/* - types and functions for cdromBus -*/ - -// isNullableString -type ImageConfigGetCdromBusAttributeType = *NullableString - -func getImageConfigGetCdromBusAttributeTypeOk(arg ImageConfigGetCdromBusAttributeType) (ret ImageConfigGetCdromBusRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetCdromBusAttributeType(arg *ImageConfigGetCdromBusAttributeType, val ImageConfigGetCdromBusRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetCdromBusArgType = *string -type ImageConfigGetCdromBusRetType = *string - -/* - types and functions for diskBus -*/ - -// isNullableString -type ImageConfigGetDiskBusAttributeType = *NullableString - -func getImageConfigGetDiskBusAttributeTypeOk(arg ImageConfigGetDiskBusAttributeType) (ret ImageConfigGetDiskBusRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetDiskBusAttributeType(arg *ImageConfigGetDiskBusAttributeType, val ImageConfigGetDiskBusRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetDiskBusArgType = *string -type ImageConfigGetDiskBusRetType = *string - -/* - types and functions for nicModel -*/ - -// isNullableString -type ImageConfigGetNicModelAttributeType = *NullableString - -func getImageConfigGetNicModelAttributeTypeOk(arg ImageConfigGetNicModelAttributeType) (ret ImageConfigGetNicModelRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetNicModelAttributeType(arg *ImageConfigGetNicModelAttributeType, val ImageConfigGetNicModelRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetNicModelArgType = *string -type ImageConfigGetNicModelRetType = *string - -/* - types and functions for operatingSystem -*/ - -// isNotNullableString -type ImageConfigGetOperatingSystemAttributeType = *string - -func getImageConfigGetOperatingSystemAttributeTypeOk(arg ImageConfigGetOperatingSystemAttributeType) (ret ImageConfigGetOperatingSystemRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfigGetOperatingSystemAttributeType(arg *ImageConfigGetOperatingSystemAttributeType, val ImageConfigGetOperatingSystemRetType) { - *arg = &val -} - -type ImageConfigGetOperatingSystemArgType = string -type ImageConfigGetOperatingSystemRetType = string - -/* - types and functions for operatingSystemDistro -*/ - -// isNullableString -type ImageConfigGetOperatingSystemDistroAttributeType = *NullableString - -func getImageConfigGetOperatingSystemDistroAttributeTypeOk(arg ImageConfigGetOperatingSystemDistroAttributeType) (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetOperatingSystemDistroAttributeType(arg *ImageConfigGetOperatingSystemDistroAttributeType, val ImageConfigGetOperatingSystemDistroRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetOperatingSystemDistroArgType = *string -type ImageConfigGetOperatingSystemDistroRetType = *string - -/* - types and functions for operatingSystemVersion -*/ - -// isNullableString -type ImageConfigGetOperatingSystemVersionAttributeType = *NullableString - -func getImageConfigGetOperatingSystemVersionAttributeTypeOk(arg ImageConfigGetOperatingSystemVersionAttributeType) (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetOperatingSystemVersionAttributeType(arg *ImageConfigGetOperatingSystemVersionAttributeType, val ImageConfigGetOperatingSystemVersionRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetOperatingSystemVersionArgType = *string -type ImageConfigGetOperatingSystemVersionRetType = *string - -/* - types and functions for rescueBus -*/ - -// isNullableString -type ImageConfigGetRescueBusAttributeType = *NullableString - -func getImageConfigGetRescueBusAttributeTypeOk(arg ImageConfigGetRescueBusAttributeType) (ret ImageConfigGetRescueBusRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetRescueBusAttributeType(arg *ImageConfigGetRescueBusAttributeType, val ImageConfigGetRescueBusRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetRescueBusArgType = *string -type ImageConfigGetRescueBusRetType = *string - -/* - types and functions for rescueDevice -*/ - -// isNullableString -type ImageConfigGetRescueDeviceAttributeType = *NullableString - -func getImageConfigGetRescueDeviceAttributeTypeOk(arg ImageConfigGetRescueDeviceAttributeType) (ret ImageConfigGetRescueDeviceRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetRescueDeviceAttributeType(arg *ImageConfigGetRescueDeviceAttributeType, val ImageConfigGetRescueDeviceRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetRescueDeviceArgType = *string -type ImageConfigGetRescueDeviceRetType = *string - -/* - types and functions for secureBoot -*/ - -// isBoolean -type ImageConfiggetSecureBootAttributeType = *bool -type ImageConfiggetSecureBootArgType = bool -type ImageConfiggetSecureBootRetType = bool - -func getImageConfiggetSecureBootAttributeTypeOk(arg ImageConfiggetSecureBootAttributeType) (ret ImageConfiggetSecureBootRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfiggetSecureBootAttributeType(arg *ImageConfiggetSecureBootAttributeType, val ImageConfiggetSecureBootRetType) { - *arg = &val -} - -/* - types and functions for uefi -*/ - -// isBoolean -type ImageConfiggetUefiAttributeType = *bool -type ImageConfiggetUefiArgType = bool -type ImageConfiggetUefiRetType = bool - -func getImageConfiggetUefiAttributeTypeOk(arg ImageConfiggetUefiAttributeType) (ret ImageConfiggetUefiRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfiggetUefiAttributeType(arg *ImageConfiggetUefiAttributeType, val ImageConfiggetUefiRetType) { - *arg = &val -} - -/* - types and functions for videoModel -*/ - -// isNullableString -type ImageConfigGetVideoModelAttributeType = *NullableString - -func getImageConfigGetVideoModelAttributeTypeOk(arg ImageConfigGetVideoModelAttributeType) (ret ImageConfigGetVideoModelRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setImageConfigGetVideoModelAttributeType(arg *ImageConfigGetVideoModelAttributeType, val ImageConfigGetVideoModelRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type ImageConfigGetVideoModelArgType = *string -type ImageConfigGetVideoModelRetType = *string - -/* - types and functions for virtioScsi -*/ - -// isBoolean -type ImageConfiggetVirtioScsiAttributeType = *bool -type ImageConfiggetVirtioScsiArgType = bool -type ImageConfiggetVirtioScsiRetType = bool - -func getImageConfiggetVirtioScsiAttributeTypeOk(arg ImageConfiggetVirtioScsiAttributeType) (ret ImageConfiggetVirtioScsiRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageConfiggetVirtioScsiAttributeType(arg *ImageConfiggetVirtioScsiAttributeType, val ImageConfiggetVirtioScsiRetType) { - *arg = &val -} - -// ImageConfig Properties to set hardware and scheduling settings for an Image. -type ImageConfig struct { - // Represents CPU architecture. The default for new images is x86. - Architecture ImageConfigGetArchitectureAttributeType `json:"architecture,omitempty"` - // Enables the BIOS bootmenu. The default for new images is disabled. - BootMenu ImageConfiggetBootMenuAttributeType `json:"bootMenu,omitempty"` - // Sets CDROM bus controller type. - CdromBus ImageConfigGetCdromBusAttributeType `json:"cdromBus,omitempty"` - // Sets Disk bus controller type. - DiskBus ImageConfigGetDiskBusAttributeType `json:"diskBus,omitempty"` - // Sets virtual nic model. - NicModel ImageConfigGetNicModelAttributeType `json:"nicModel,omitempty"` - // Enables OS specific optimizations. - OperatingSystem ImageConfigGetOperatingSystemAttributeType `json:"operatingSystem,omitempty"` - // Operating System Distribution. - OperatingSystemDistro ImageConfigGetOperatingSystemDistroAttributeType `json:"operatingSystemDistro,omitempty"` - // Version of the OS. - OperatingSystemVersion ImageConfigGetOperatingSystemVersionAttributeType `json:"operatingSystemVersion,omitempty"` - // Sets the device bus when the image is used as a rescue image. - RescueBus ImageConfigGetRescueBusAttributeType `json:"rescueBus,omitempty"` - // Sets the device when the image is used as a rescue image. - RescueDevice ImageConfigGetRescueDeviceAttributeType `json:"rescueDevice,omitempty"` - // Enables Secure Boot. The default for new images is disabled. - SecureBoot ImageConfiggetSecureBootAttributeType `json:"secureBoot,omitempty"` - // Configure UEFI boot. The default for new images is enabled. - Uefi ImageConfiggetUefiAttributeType `json:"uefi,omitempty"` - // Sets Graphic device model. - VideoModel ImageConfigGetVideoModelAttributeType `json:"videoModel,omitempty"` - // Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block. - VirtioScsi ImageConfiggetVirtioScsiAttributeType `json:"virtioScsi,omitempty"` -} - -// NewImageConfig instantiates a new ImageConfig 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 NewImageConfig() *ImageConfig { - this := ImageConfig{} - return &this -} - -// NewImageConfigWithDefaults instantiates a new ImageConfig 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 NewImageConfigWithDefaults() *ImageConfig { - this := ImageConfig{} - return &this -} - -// GetArchitecture returns the Architecture field value if set, zero value otherwise. -func (o *ImageConfig) GetArchitecture() (res ImageConfigGetArchitectureRetType) { - res, _ = o.GetArchitectureOk() - return -} - -// GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetArchitectureOk() (ret ImageConfigGetArchitectureRetType, ok bool) { - return getImageConfigGetArchitectureAttributeTypeOk(o.Architecture) -} - -// HasArchitecture returns a boolean if a field has been set. -func (o *ImageConfig) HasArchitecture() bool { - _, ok := o.GetArchitectureOk() - return ok -} - -// SetArchitecture gets a reference to the given string and assigns it to the Architecture field. -func (o *ImageConfig) SetArchitecture(v ImageConfigGetArchitectureRetType) { - setImageConfigGetArchitectureAttributeType(&o.Architecture, v) -} - -// GetBootMenu returns the BootMenu field value if set, zero value otherwise. -func (o *ImageConfig) GetBootMenu() (res ImageConfiggetBootMenuRetType) { - res, _ = o.GetBootMenuOk() - return -} - -// GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetBootMenuOk() (ret ImageConfiggetBootMenuRetType, ok bool) { - return getImageConfiggetBootMenuAttributeTypeOk(o.BootMenu) -} - -// HasBootMenu returns a boolean if a field has been set. -func (o *ImageConfig) HasBootMenu() bool { - _, ok := o.GetBootMenuOk() - return ok -} - -// SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. -func (o *ImageConfig) SetBootMenu(v ImageConfiggetBootMenuRetType) { - setImageConfiggetBootMenuAttributeType(&o.BootMenu, v) -} - -// GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetCdromBus() (res ImageConfigGetCdromBusRetType) { - res, _ = o.GetCdromBusOk() - return -} - -// GetCdromBusOk returns a tuple with the CdromBus 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 *ImageConfig) GetCdromBusOk() (ret ImageConfigGetCdromBusRetType, ok bool) { - return getImageConfigGetCdromBusAttributeTypeOk(o.CdromBus) -} - -// HasCdromBus returns a boolean if a field has been set. -func (o *ImageConfig) HasCdromBus() bool { - _, ok := o.GetCdromBusOk() - return ok -} - -// SetCdromBus gets a reference to the given string and assigns it to the CdromBus field. -func (o *ImageConfig) SetCdromBus(v ImageConfigGetCdromBusRetType) { - setImageConfigGetCdromBusAttributeType(&o.CdromBus, v) -} - -// SetCdromBusNil sets the value for CdromBus to be an explicit nil -func (o *ImageConfig) SetCdromBusNil() { - o.CdromBus = nil -} - -// UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil -func (o *ImageConfig) UnsetCdromBus() { - o.CdromBus = nil -} - -// GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetDiskBus() (res ImageConfigGetDiskBusRetType) { - res, _ = o.GetDiskBusOk() - return -} - -// GetDiskBusOk returns a tuple with the DiskBus 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 *ImageConfig) GetDiskBusOk() (ret ImageConfigGetDiskBusRetType, ok bool) { - return getImageConfigGetDiskBusAttributeTypeOk(o.DiskBus) -} - -// HasDiskBus returns a boolean if a field has been set. -func (o *ImageConfig) HasDiskBus() bool { - _, ok := o.GetDiskBusOk() - return ok -} - -// SetDiskBus gets a reference to the given string and assigns it to the DiskBus field. -func (o *ImageConfig) SetDiskBus(v ImageConfigGetDiskBusRetType) { - setImageConfigGetDiskBusAttributeType(&o.DiskBus, v) -} - -// SetDiskBusNil sets the value for DiskBus to be an explicit nil -func (o *ImageConfig) SetDiskBusNil() { - o.DiskBus = nil -} - -// UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil -func (o *ImageConfig) UnsetDiskBus() { - o.DiskBus = nil -} - -// GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetNicModel() (res ImageConfigGetNicModelRetType) { - res, _ = o.GetNicModelOk() - return -} - -// GetNicModelOk returns a tuple with the NicModel 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 *ImageConfig) GetNicModelOk() (ret ImageConfigGetNicModelRetType, ok bool) { - return getImageConfigGetNicModelAttributeTypeOk(o.NicModel) -} - -// HasNicModel returns a boolean if a field has been set. -func (o *ImageConfig) HasNicModel() bool { - _, ok := o.GetNicModelOk() - return ok -} - -// SetNicModel gets a reference to the given string and assigns it to the NicModel field. -func (o *ImageConfig) SetNicModel(v ImageConfigGetNicModelRetType) { - setImageConfigGetNicModelAttributeType(&o.NicModel, v) -} - -// SetNicModelNil sets the value for NicModel to be an explicit nil -func (o *ImageConfig) SetNicModelNil() { - o.NicModel = nil -} - -// UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil -func (o *ImageConfig) UnsetNicModel() { - o.NicModel = nil -} - -// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. -func (o *ImageConfig) GetOperatingSystem() (res ImageConfigGetOperatingSystemRetType) { - res, _ = o.GetOperatingSystemOk() - return -} - -// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetOperatingSystemOk() (ret ImageConfigGetOperatingSystemRetType, ok bool) { - return getImageConfigGetOperatingSystemAttributeTypeOk(o.OperatingSystem) -} - -// HasOperatingSystem returns a boolean if a field has been set. -func (o *ImageConfig) HasOperatingSystem() bool { - _, ok := o.GetOperatingSystemOk() - return ok -} - -// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. -func (o *ImageConfig) SetOperatingSystem(v ImageConfigGetOperatingSystemRetType) { - setImageConfigGetOperatingSystemAttributeType(&o.OperatingSystem, v) -} - -// GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetOperatingSystemDistro() (res ImageConfigGetOperatingSystemDistroRetType) { - res, _ = o.GetOperatingSystemDistroOk() - return -} - -// GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro 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 *ImageConfig) GetOperatingSystemDistroOk() (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { - return getImageConfigGetOperatingSystemDistroAttributeTypeOk(o.OperatingSystemDistro) -} - -// HasOperatingSystemDistro returns a boolean if a field has been set. -func (o *ImageConfig) HasOperatingSystemDistro() bool { - _, ok := o.GetOperatingSystemDistroOk() - return ok -} - -// SetOperatingSystemDistro gets a reference to the given string and assigns it to the OperatingSystemDistro field. -func (o *ImageConfig) SetOperatingSystemDistro(v ImageConfigGetOperatingSystemDistroRetType) { - setImageConfigGetOperatingSystemDistroAttributeType(&o.OperatingSystemDistro, v) -} - -// SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil -func (o *ImageConfig) SetOperatingSystemDistroNil() { - o.OperatingSystemDistro = nil -} - -// UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil -func (o *ImageConfig) UnsetOperatingSystemDistro() { - o.OperatingSystemDistro = nil -} - -// GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetOperatingSystemVersion() (res ImageConfigGetOperatingSystemVersionRetType) { - res, _ = o.GetOperatingSystemVersionOk() - return -} - -// GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion 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 *ImageConfig) GetOperatingSystemVersionOk() (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { - return getImageConfigGetOperatingSystemVersionAttributeTypeOk(o.OperatingSystemVersion) -} - -// HasOperatingSystemVersion returns a boolean if a field has been set. -func (o *ImageConfig) HasOperatingSystemVersion() bool { - _, ok := o.GetOperatingSystemVersionOk() - return ok -} - -// SetOperatingSystemVersion gets a reference to the given string and assigns it to the OperatingSystemVersion field. -func (o *ImageConfig) SetOperatingSystemVersion(v ImageConfigGetOperatingSystemVersionRetType) { - setImageConfigGetOperatingSystemVersionAttributeType(&o.OperatingSystemVersion, v) -} - -// SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil -func (o *ImageConfig) SetOperatingSystemVersionNil() { - o.OperatingSystemVersion = nil -} - -// UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil -func (o *ImageConfig) UnsetOperatingSystemVersion() { - o.OperatingSystemVersion = nil -} - -// GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetRescueBus() (res ImageConfigGetRescueBusRetType) { - res, _ = o.GetRescueBusOk() - return -} - -// GetRescueBusOk returns a tuple with the RescueBus 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 *ImageConfig) GetRescueBusOk() (ret ImageConfigGetRescueBusRetType, ok bool) { - return getImageConfigGetRescueBusAttributeTypeOk(o.RescueBus) -} - -// HasRescueBus returns a boolean if a field has been set. -func (o *ImageConfig) HasRescueBus() bool { - _, ok := o.GetRescueBusOk() - return ok -} - -// SetRescueBus gets a reference to the given string and assigns it to the RescueBus field. -func (o *ImageConfig) SetRescueBus(v ImageConfigGetRescueBusRetType) { - setImageConfigGetRescueBusAttributeType(&o.RescueBus, v) -} - -// SetRescueBusNil sets the value for RescueBus to be an explicit nil -func (o *ImageConfig) SetRescueBusNil() { - o.RescueBus = nil -} - -// UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil -func (o *ImageConfig) UnsetRescueBus() { - o.RescueBus = nil -} - -// GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetRescueDevice() (res ImageConfigGetRescueDeviceRetType) { - res, _ = o.GetRescueDeviceOk() - return -} - -// GetRescueDeviceOk returns a tuple with the RescueDevice 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 *ImageConfig) GetRescueDeviceOk() (ret ImageConfigGetRescueDeviceRetType, ok bool) { - return getImageConfigGetRescueDeviceAttributeTypeOk(o.RescueDevice) -} - -// HasRescueDevice returns a boolean if a field has been set. -func (o *ImageConfig) HasRescueDevice() bool { - _, ok := o.GetRescueDeviceOk() - return ok -} - -// SetRescueDevice gets a reference to the given string and assigns it to the RescueDevice field. -func (o *ImageConfig) SetRescueDevice(v ImageConfigGetRescueDeviceRetType) { - setImageConfigGetRescueDeviceAttributeType(&o.RescueDevice, v) -} - -// SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil -func (o *ImageConfig) SetRescueDeviceNil() { - o.RescueDevice = nil -} - -// UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil -func (o *ImageConfig) UnsetRescueDevice() { - o.RescueDevice = nil -} - -// GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. -func (o *ImageConfig) GetSecureBoot() (res ImageConfiggetSecureBootRetType) { - res, _ = o.GetSecureBootOk() - return -} - -// GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetSecureBootOk() (ret ImageConfiggetSecureBootRetType, ok bool) { - return getImageConfiggetSecureBootAttributeTypeOk(o.SecureBoot) -} - -// HasSecureBoot returns a boolean if a field has been set. -func (o *ImageConfig) HasSecureBoot() bool { - _, ok := o.GetSecureBootOk() - return ok -} - -// SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. -func (o *ImageConfig) SetSecureBoot(v ImageConfiggetSecureBootRetType) { - setImageConfiggetSecureBootAttributeType(&o.SecureBoot, v) -} - -// GetUefi returns the Uefi field value if set, zero value otherwise. -func (o *ImageConfig) GetUefi() (res ImageConfiggetUefiRetType) { - res, _ = o.GetUefiOk() - return -} - -// GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetUefiOk() (ret ImageConfiggetUefiRetType, ok bool) { - return getImageConfiggetUefiAttributeTypeOk(o.Uefi) -} - -// HasUefi returns a boolean if a field has been set. -func (o *ImageConfig) HasUefi() bool { - _, ok := o.GetUefiOk() - return ok -} - -// SetUefi gets a reference to the given bool and assigns it to the Uefi field. -func (o *ImageConfig) SetUefi(v ImageConfiggetUefiRetType) { - setImageConfiggetUefiAttributeType(&o.Uefi, v) -} - -// GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetVideoModel() (res ImageConfigGetVideoModelRetType) { - res, _ = o.GetVideoModelOk() - return -} - -// GetVideoModelOk returns a tuple with the VideoModel 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 *ImageConfig) GetVideoModelOk() (ret ImageConfigGetVideoModelRetType, ok bool) { - return getImageConfigGetVideoModelAttributeTypeOk(o.VideoModel) -} - -// HasVideoModel returns a boolean if a field has been set. -func (o *ImageConfig) HasVideoModel() bool { - _, ok := o.GetVideoModelOk() - return ok -} - -// SetVideoModel gets a reference to the given string and assigns it to the VideoModel field. -func (o *ImageConfig) SetVideoModel(v ImageConfigGetVideoModelRetType) { - setImageConfigGetVideoModelAttributeType(&o.VideoModel, v) -} - -// SetVideoModelNil sets the value for VideoModel to be an explicit nil -func (o *ImageConfig) SetVideoModelNil() { - o.VideoModel = nil -} - -// UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil -func (o *ImageConfig) UnsetVideoModel() { - o.VideoModel = nil -} - -// GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. -func (o *ImageConfig) GetVirtioScsi() (res ImageConfiggetVirtioScsiRetType) { - res, _ = o.GetVirtioScsiOk() - return -} - -// GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageConfig) GetVirtioScsiOk() (ret ImageConfiggetVirtioScsiRetType, ok bool) { - return getImageConfiggetVirtioScsiAttributeTypeOk(o.VirtioScsi) -} - -// HasVirtioScsi returns a boolean if a field has been set. -func (o *ImageConfig) HasVirtioScsi() bool { - _, ok := o.GetVirtioScsiOk() - return ok -} - -// SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. -func (o *ImageConfig) SetVirtioScsi(v ImageConfiggetVirtioScsiRetType) { - setImageConfiggetVirtioScsiAttributeType(&o.VirtioScsi, v) -} - -func (o ImageConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageConfigGetArchitectureAttributeTypeOk(o.Architecture); ok { - toSerialize["Architecture"] = val - } - if val, ok := getImageConfiggetBootMenuAttributeTypeOk(o.BootMenu); ok { - toSerialize["BootMenu"] = val - } - if val, ok := getImageConfigGetCdromBusAttributeTypeOk(o.CdromBus); ok { - toSerialize["CdromBus"] = val - } - if val, ok := getImageConfigGetDiskBusAttributeTypeOk(o.DiskBus); ok { - toSerialize["DiskBus"] = val - } - if val, ok := getImageConfigGetNicModelAttributeTypeOk(o.NicModel); ok { - toSerialize["NicModel"] = val - } - if val, ok := getImageConfigGetOperatingSystemAttributeTypeOk(o.OperatingSystem); ok { - toSerialize["OperatingSystem"] = val - } - if val, ok := getImageConfigGetOperatingSystemDistroAttributeTypeOk(o.OperatingSystemDistro); ok { - toSerialize["OperatingSystemDistro"] = val - } - if val, ok := getImageConfigGetOperatingSystemVersionAttributeTypeOk(o.OperatingSystemVersion); ok { - toSerialize["OperatingSystemVersion"] = val - } - if val, ok := getImageConfigGetRescueBusAttributeTypeOk(o.RescueBus); ok { - toSerialize["RescueBus"] = val - } - if val, ok := getImageConfigGetRescueDeviceAttributeTypeOk(o.RescueDevice); ok { - toSerialize["RescueDevice"] = val - } - if val, ok := getImageConfiggetSecureBootAttributeTypeOk(o.SecureBoot); ok { - toSerialize["SecureBoot"] = val - } - if val, ok := getImageConfiggetUefiAttributeTypeOk(o.Uefi); ok { - toSerialize["Uefi"] = val - } - if val, ok := getImageConfigGetVideoModelAttributeTypeOk(o.VideoModel); ok { - toSerialize["VideoModel"] = val - } - if val, ok := getImageConfiggetVirtioScsiAttributeTypeOk(o.VirtioScsi); ok { - toSerialize["VirtioScsi"] = val - } - return toSerialize, nil -} - -type NullableImageConfig struct { - value *ImageConfig - isSet bool -} - -func (v NullableImageConfig) Get() *ImageConfig { - return v.value -} - -func (v *NullableImageConfig) Set(val *ImageConfig) { - v.value = val - v.isSet = true -} - -func (v NullableImageConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableImageConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageConfig(val *ImageConfig) *NullableImageConfig { - return &NullableImageConfig{value: val, isSet: true} -} - -func (v NullableImageConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_config_test.go b/services/iaasalpha/model_image_config_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_config_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_create_response.go b/services/iaasalpha/model_image_create_response.go deleted file mode 100644 index c30c61c6c..000000000 --- a/services/iaasalpha/model_image_create_response.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ImageCreateResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageCreateResponse{} - -/* - types and functions for id -*/ - -// isNotNullableString -type ImageCreateResponseGetIdAttributeType = *string - -func getImageCreateResponseGetIdAttributeTypeOk(arg ImageCreateResponseGetIdAttributeType) (ret ImageCreateResponseGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageCreateResponseGetIdAttributeType(arg *ImageCreateResponseGetIdAttributeType, val ImageCreateResponseGetIdRetType) { - *arg = &val -} - -type ImageCreateResponseGetIdArgType = string -type ImageCreateResponseGetIdRetType = string - -/* - types and functions for uploadUrl -*/ - -// isNotNullableString -type ImageCreateResponseGetUploadUrlAttributeType = *string - -func getImageCreateResponseGetUploadUrlAttributeTypeOk(arg ImageCreateResponseGetUploadUrlAttributeType) (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageCreateResponseGetUploadUrlAttributeType(arg *ImageCreateResponseGetUploadUrlAttributeType, val ImageCreateResponseGetUploadUrlRetType) { - *arg = &val -} - -type ImageCreateResponseGetUploadUrlArgType = string -type ImageCreateResponseGetUploadUrlRetType = string - -// ImageCreateResponse Image creation response. -type ImageCreateResponse struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Id ImageCreateResponseGetIdAttributeType `json:"id" required:"true"` - // REQUIRED - UploadUrl ImageCreateResponseGetUploadUrlAttributeType `json:"uploadUrl" required:"true"` -} - -type _ImageCreateResponse ImageCreateResponse - -// NewImageCreateResponse instantiates a new ImageCreateResponse 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 NewImageCreateResponse(id ImageCreateResponseGetIdArgType, uploadUrl ImageCreateResponseGetUploadUrlArgType) *ImageCreateResponse { - this := ImageCreateResponse{} - setImageCreateResponseGetIdAttributeType(&this.Id, id) - setImageCreateResponseGetUploadUrlAttributeType(&this.UploadUrl, uploadUrl) - return &this -} - -// NewImageCreateResponseWithDefaults instantiates a new ImageCreateResponse 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 NewImageCreateResponseWithDefaults() *ImageCreateResponse { - this := ImageCreateResponse{} - return &this -} - -// GetId returns the Id field value -func (o *ImageCreateResponse) GetId() (ret ImageCreateResponseGetIdRetType) { - 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 *ImageCreateResponse) GetIdOk() (ret ImageCreateResponseGetIdRetType, ok bool) { - return getImageCreateResponseGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *ImageCreateResponse) SetId(v ImageCreateResponseGetIdRetType) { - setImageCreateResponseGetIdAttributeType(&o.Id, v) -} - -// GetUploadUrl returns the UploadUrl field value -func (o *ImageCreateResponse) GetUploadUrl() (ret ImageCreateResponseGetUploadUrlRetType) { - ret, _ = o.GetUploadUrlOk() - return ret -} - -// GetUploadUrlOk returns a tuple with the UploadUrl field value -// and a boolean to check if the value has been set. -func (o *ImageCreateResponse) GetUploadUrlOk() (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { - return getImageCreateResponseGetUploadUrlAttributeTypeOk(o.UploadUrl) -} - -// SetUploadUrl sets field value -func (o *ImageCreateResponse) SetUploadUrl(v ImageCreateResponseGetUploadUrlRetType) { - setImageCreateResponseGetUploadUrlAttributeType(&o.UploadUrl, v) -} - -func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageCreateResponseGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getImageCreateResponseGetUploadUrlAttributeTypeOk(o.UploadUrl); ok { - toSerialize["UploadUrl"] = val - } - return toSerialize, nil -} - -type NullableImageCreateResponse struct { - value *ImageCreateResponse - isSet bool -} - -func (v NullableImageCreateResponse) Get() *ImageCreateResponse { - return v.value -} - -func (v *NullableImageCreateResponse) Set(val *ImageCreateResponse) { - v.value = val - v.isSet = true -} - -func (v NullableImageCreateResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableImageCreateResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageCreateResponse(val *ImageCreateResponse) *NullableImageCreateResponse { - return &NullableImageCreateResponse{value: val, isSet: true} -} - -func (v NullableImageCreateResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageCreateResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_create_response_test.go b/services/iaasalpha/model_image_create_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_create_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_list_response.go b/services/iaasalpha/model_image_list_response.go deleted file mode 100644 index 103dff6f3..000000000 --- a/services/iaasalpha/model_image_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ImageListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageListResponse{} - -/* - types and functions for items -*/ - -// isArray -type ImageListResponseGetItemsAttributeType = *[]Image -type ImageListResponseGetItemsArgType = []Image -type ImageListResponseGetItemsRetType = []Image - -func getImageListResponseGetItemsAttributeTypeOk(arg ImageListResponseGetItemsAttributeType) (ret ImageListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageListResponseGetItemsAttributeType(arg *ImageListResponseGetItemsAttributeType, val ImageListResponseGetItemsRetType) { - *arg = &val -} - -// ImageListResponse Image list response. -type ImageListResponse struct { - // A list containing image objects. - // REQUIRED - Items ImageListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _ImageListResponse ImageListResponse - -// NewImageListResponse instantiates a new ImageListResponse 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 NewImageListResponse(items ImageListResponseGetItemsArgType) *ImageListResponse { - this := ImageListResponse{} - setImageListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewImageListResponseWithDefaults instantiates a new ImageListResponse 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 NewImageListResponseWithDefaults() *ImageListResponse { - this := ImageListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *ImageListResponse) GetItems() (ret ImageListResponseGetItemsRetType) { - 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 *ImageListResponse) GetItemsOk() (ret ImageListResponseGetItemsRetType, ok bool) { - return getImageListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *ImageListResponse) SetItems(v ImageListResponseGetItemsRetType) { - setImageListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o ImageListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableImageListResponse struct { - value *ImageListResponse - isSet bool -} - -func (v NullableImageListResponse) Get() *ImageListResponse { - return v.value -} - -func (v *NullableImageListResponse) Set(val *ImageListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableImageListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableImageListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageListResponse(val *ImageListResponse) *NullableImageListResponse { - return &NullableImageListResponse{value: val, isSet: true} -} - -func (v NullableImageListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_list_response_test.go b/services/iaasalpha/model_image_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_share.go b/services/iaasalpha/model_image_share.go deleted file mode 100644 index 9ae0d69bc..000000000 --- a/services/iaasalpha/model_image_share.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ImageShare type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageShare{} - -/* - types and functions for parentOrganization -*/ - -// isBoolean -type ImageSharegetParentOrganizationAttributeType = *bool -type ImageSharegetParentOrganizationArgType = bool -type ImageSharegetParentOrganizationRetType = bool - -func getImageSharegetParentOrganizationAttributeTypeOk(arg ImageSharegetParentOrganizationAttributeType) (ret ImageSharegetParentOrganizationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageSharegetParentOrganizationAttributeType(arg *ImageSharegetParentOrganizationAttributeType, val ImageSharegetParentOrganizationRetType) { - *arg = &val -} - -/* - types and functions for projects -*/ - -// isArray -type ImageShareGetProjectsAttributeType = *[]string -type ImageShareGetProjectsArgType = []string -type ImageShareGetProjectsRetType = []string - -func getImageShareGetProjectsAttributeTypeOk(arg ImageShareGetProjectsAttributeType) (ret ImageShareGetProjectsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageShareGetProjectsAttributeType(arg *ImageShareGetProjectsAttributeType, val ImageShareGetProjectsRetType) { - *arg = &val -} - -// ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. -type ImageShare struct { - // Image is shared with all projects inside the image owners organization. - ParentOrganization ImageSharegetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` - // List of all projects the Image is shared with. - Projects ImageShareGetProjectsAttributeType `json:"projects,omitempty"` -} - -// NewImageShare instantiates a new ImageShare 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 NewImageShare() *ImageShare { - this := ImageShare{} - return &this -} - -// NewImageShareWithDefaults instantiates a new ImageShare 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 NewImageShareWithDefaults() *ImageShare { - this := ImageShare{} - return &this -} - -// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *ImageShare) GetParentOrganization() (res ImageSharegetParentOrganizationRetType) { - res, _ = o.GetParentOrganizationOk() - return -} - -// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageShare) GetParentOrganizationOk() (ret ImageSharegetParentOrganizationRetType, ok bool) { - return getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization) -} - -// HasParentOrganization returns a boolean if a field has been set. -func (o *ImageShare) HasParentOrganization() bool { - _, ok := o.GetParentOrganizationOk() - return ok -} - -// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *ImageShare) SetParentOrganization(v ImageSharegetParentOrganizationRetType) { - setImageSharegetParentOrganizationAttributeType(&o.ParentOrganization, v) -} - -// GetProjects returns the Projects field value if set, zero value otherwise. -func (o *ImageShare) GetProjects() (res ImageShareGetProjectsRetType) { - res, _ = o.GetProjectsOk() - return -} - -// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageShare) GetProjectsOk() (ret ImageShareGetProjectsRetType, ok bool) { - return getImageShareGetProjectsAttributeTypeOk(o.Projects) -} - -// HasProjects returns a boolean if a field has been set. -func (o *ImageShare) HasProjects() bool { - _, ok := o.GetProjectsOk() - return ok -} - -// SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *ImageShare) SetProjects(v ImageShareGetProjectsRetType) { - setImageShareGetProjectsAttributeType(&o.Projects, v) -} - -func (o ImageShare) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { - toSerialize["ParentOrganization"] = val - } - if val, ok := getImageShareGetProjectsAttributeTypeOk(o.Projects); ok { - toSerialize["Projects"] = val - } - return toSerialize, nil -} - -type NullableImageShare struct { - value *ImageShare - isSet bool -} - -func (v NullableImageShare) Get() *ImageShare { - return v.value -} - -func (v *NullableImageShare) Set(val *ImageShare) { - v.value = val - v.isSet = true -} - -func (v NullableImageShare) IsSet() bool { - return v.isSet -} - -func (v *NullableImageShare) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageShare(val *ImageShare) *NullableImageShare { - return &NullableImageShare{value: val, isSet: true} -} - -func (v NullableImageShare) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageShare) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_share_consumer.go b/services/iaasalpha/model_image_share_consumer.go deleted file mode 100644 index 484a8f483..000000000 --- a/services/iaasalpha/model_image_share_consumer.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ImageShareConsumer{} - -/* - types and functions for consumerProjectId -*/ - -// isNotNullableString -type ImageShareConsumerGetConsumerProjectIdAttributeType = *string - -func getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(arg ImageShareConsumerGetConsumerProjectIdAttributeType) (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageShareConsumerGetConsumerProjectIdAttributeType(arg *ImageShareConsumerGetConsumerProjectIdAttributeType, val ImageShareConsumerGetConsumerProjectIdRetType) { - *arg = &val -} - -type ImageShareConsumerGetConsumerProjectIdArgType = string -type ImageShareConsumerGetConsumerProjectIdRetType = string - -/* - types and functions for createdAt -*/ - -// isDateTime -type ImageShareConsumerGetCreatedAtAttributeType = *time.Time -type ImageShareConsumerGetCreatedAtArgType = time.Time -type ImageShareConsumerGetCreatedAtRetType = time.Time - -func getImageShareConsumerGetCreatedAtAttributeTypeOk(arg ImageShareConsumerGetCreatedAtAttributeType) (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageShareConsumerGetCreatedAtAttributeType(arg *ImageShareConsumerGetCreatedAtAttributeType, val ImageShareConsumerGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for imageId -*/ - -// isNotNullableString -type ImageShareConsumerGetImageIdAttributeType = *string - -func getImageShareConsumerGetImageIdAttributeTypeOk(arg ImageShareConsumerGetImageIdAttributeType) (ret ImageShareConsumerGetImageIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageShareConsumerGetImageIdAttributeType(arg *ImageShareConsumerGetImageIdAttributeType, val ImageShareConsumerGetImageIdRetType) { - *arg = &val -} - -type ImageShareConsumerGetImageIdArgType = string -type ImageShareConsumerGetImageIdRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type ImageShareConsumerGetUpdatedAtAttributeType = *time.Time -type ImageShareConsumerGetUpdatedAtArgType = time.Time -type ImageShareConsumerGetUpdatedAtRetType = time.Time - -func getImageShareConsumerGetUpdatedAtAttributeTypeOk(arg ImageShareConsumerGetUpdatedAtAttributeType) (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setImageShareConsumerGetUpdatedAtAttributeType(arg *ImageShareConsumerGetUpdatedAtAttributeType, val ImageShareConsumerGetUpdatedAtRetType) { - *arg = &val -} - -// ImageShareConsumer The details of an Image share consumer. -type ImageShareConsumer struct { - // Universally Unique Identifier (UUID). - ConsumerProjectId ImageShareConsumerGetConsumerProjectIdAttributeType `json:"consumerProjectId,omitempty"` - // Date-time when resource was created. - CreatedAt ImageShareConsumerGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - ImageId ImageShareConsumerGetImageIdAttributeType `json:"imageId,omitempty"` - // Date-time when resource was last updated. - UpdatedAt ImageShareConsumerGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -// NewImageShareConsumer instantiates a new ImageShareConsumer 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 NewImageShareConsumer() *ImageShareConsumer { - this := ImageShareConsumer{} - return &this -} - -// NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer 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 NewImageShareConsumerWithDefaults() *ImageShareConsumer { - this := ImageShareConsumer{} - return &this -} - -// GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetConsumerProjectId() (res ImageShareConsumerGetConsumerProjectIdRetType) { - res, _ = o.GetConsumerProjectIdOk() - return -} - -// GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetConsumerProjectIdOk() (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { - return getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId) -} - -// HasConsumerProjectId returns a boolean if a field has been set. -func (o *ImageShareConsumer) HasConsumerProjectId() bool { - _, ok := o.GetConsumerProjectIdOk() - return ok -} - -// SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. -func (o *ImageShareConsumer) SetConsumerProjectId(v ImageShareConsumerGetConsumerProjectIdRetType) { - setImageShareConsumerGetConsumerProjectIdAttributeType(&o.ConsumerProjectId, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetCreatedAt() (res ImageShareConsumerGetCreatedAtRetType) { - 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 *ImageShareConsumer) GetCreatedAtOk() (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { - return getImageShareConsumerGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *ImageShareConsumer) 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 *ImageShareConsumer) SetCreatedAt(v ImageShareConsumerGetCreatedAtRetType) { - setImageShareConsumerGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetImageId() (res ImageShareConsumerGetImageIdRetType) { - res, _ = o.GetImageIdOk() - return -} - -// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetImageIdOk() (ret ImageShareConsumerGetImageIdRetType, ok bool) { - return getImageShareConsumerGetImageIdAttributeTypeOk(o.ImageId) -} - -// HasImageId returns a boolean if a field has been set. -func (o *ImageShareConsumer) HasImageId() bool { - _, ok := o.GetImageIdOk() - return ok -} - -// SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *ImageShareConsumer) SetImageId(v ImageShareConsumerGetImageIdRetType) { - setImageShareConsumerGetImageIdAttributeType(&o.ImageId, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetUpdatedAt() (res ImageShareConsumerGetUpdatedAtRetType) { - 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 *ImageShareConsumer) GetUpdatedAtOk() (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { - return getImageShareConsumerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *ImageShareConsumer) 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 *ImageShareConsumer) SetUpdatedAt(v ImageShareConsumerGetUpdatedAtRetType) { - setImageShareConsumerGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId); ok { - toSerialize["ConsumerProjectId"] = val - } - if val, ok := getImageShareConsumerGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getImageShareConsumerGetImageIdAttributeTypeOk(o.ImageId); ok { - toSerialize["ImageId"] = val - } - if val, ok := getImageShareConsumerGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableImageShareConsumer struct { - value *ImageShareConsumer - isSet bool -} - -func (v NullableImageShareConsumer) Get() *ImageShareConsumer { - return v.value -} - -func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { - v.value = val - v.isSet = true -} - -func (v NullableImageShareConsumer) IsSet() bool { - return v.isSet -} - -func (v *NullableImageShareConsumer) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { - return &NullableImageShareConsumer{value: val, isSet: true} -} - -func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_image_share_consumer_test.go b/services/iaasalpha/model_image_share_consumer_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_share_consumer_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_share_test.go b/services/iaasalpha/model_image_share_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_share_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_image_test.go b/services/iaasalpha/model_image_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_image_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_key_pair_list_response.go b/services/iaasalpha/model_key_pair_list_response.go deleted file mode 100644 index 912a59657..000000000 --- a/services/iaasalpha/model_key_pair_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the KeyPairListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KeyPairListResponse{} - -/* - types and functions for items -*/ - -// isArray -type KeyPairListResponseGetItemsAttributeType = *[]Keypair -type KeyPairListResponseGetItemsArgType = []Keypair -type KeyPairListResponseGetItemsRetType = []Keypair - -func getKeyPairListResponseGetItemsAttributeTypeOk(arg KeyPairListResponseGetItemsAttributeType) (ret KeyPairListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeyPairListResponseGetItemsAttributeType(arg *KeyPairListResponseGetItemsAttributeType, val KeyPairListResponseGetItemsRetType) { - *arg = &val -} - -// KeyPairListResponse SSH keypair list response. -type KeyPairListResponse struct { - // A list of SSH keypairs. - // REQUIRED - Items KeyPairListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _KeyPairListResponse KeyPairListResponse - -// NewKeyPairListResponse instantiates a new KeyPairListResponse 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 NewKeyPairListResponse(items KeyPairListResponseGetItemsArgType) *KeyPairListResponse { - this := KeyPairListResponse{} - setKeyPairListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewKeyPairListResponseWithDefaults instantiates a new KeyPairListResponse 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 NewKeyPairListResponseWithDefaults() *KeyPairListResponse { - this := KeyPairListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *KeyPairListResponse) GetItems() (ret KeyPairListResponseGetItemsRetType) { - 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 *KeyPairListResponse) GetItemsOk() (ret KeyPairListResponseGetItemsRetType, ok bool) { - return getKeyPairListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *KeyPairListResponse) SetItems(v KeyPairListResponseGetItemsRetType) { - setKeyPairListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getKeyPairListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableKeyPairListResponse struct { - value *KeyPairListResponse - isSet bool -} - -func (v NullableKeyPairListResponse) Get() *KeyPairListResponse { - return v.value -} - -func (v *NullableKeyPairListResponse) Set(val *KeyPairListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableKeyPairListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableKeyPairListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeyPairListResponse(val *KeyPairListResponse) *NullableKeyPairListResponse { - return &NullableKeyPairListResponse{value: val, isSet: true} -} - -func (v NullableKeyPairListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeyPairListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_key_pair_list_response_test.go b/services/iaasalpha/model_key_pair_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_key_pair_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_keypair.go b/services/iaasalpha/model_keypair.go deleted file mode 100644 index c7b597ae1..000000000 --- a/services/iaasalpha/model_keypair.go +++ /dev/null @@ -1,370 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Keypair type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Keypair{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type KeypairGetCreatedAtAttributeType = *time.Time -type KeypairGetCreatedAtArgType = time.Time -type KeypairGetCreatedAtRetType = time.Time - -func getKeypairGetCreatedAtAttributeTypeOk(arg KeypairGetCreatedAtAttributeType) (ret KeypairGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetCreatedAtAttributeType(arg *KeypairGetCreatedAtAttributeType, val KeypairGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for fingerprint -*/ - -// isNotNullableString -type KeypairGetFingerprintAttributeType = *string - -func getKeypairGetFingerprintAttributeTypeOk(arg KeypairGetFingerprintAttributeType) (ret KeypairGetFingerprintRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetFingerprintAttributeType(arg *KeypairGetFingerprintAttributeType, val KeypairGetFingerprintRetType) { - *arg = &val -} - -type KeypairGetFingerprintArgType = string -type KeypairGetFingerprintRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type KeypairGetLabelsAttributeType = *map[string]interface{} -type KeypairGetLabelsArgType = map[string]interface{} -type KeypairGetLabelsRetType = map[string]interface{} - -func getKeypairGetLabelsAttributeTypeOk(arg KeypairGetLabelsAttributeType) (ret KeypairGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetLabelsAttributeType(arg *KeypairGetLabelsAttributeType, val KeypairGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type KeypairGetNameAttributeType = *string - -func getKeypairGetNameAttributeTypeOk(arg KeypairGetNameAttributeType) (ret KeypairGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetNameAttributeType(arg *KeypairGetNameAttributeType, val KeypairGetNameRetType) { - *arg = &val -} - -type KeypairGetNameArgType = string -type KeypairGetNameRetType = string - -/* - types and functions for publicKey -*/ - -// isNotNullableString -type KeypairGetPublicKeyAttributeType = *string - -func getKeypairGetPublicKeyAttributeTypeOk(arg KeypairGetPublicKeyAttributeType) (ret KeypairGetPublicKeyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetPublicKeyAttributeType(arg *KeypairGetPublicKeyAttributeType, val KeypairGetPublicKeyRetType) { - *arg = &val -} - -type KeypairGetPublicKeyArgType = string -type KeypairGetPublicKeyRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type KeypairGetUpdatedAtAttributeType = *time.Time -type KeypairGetUpdatedAtArgType = time.Time -type KeypairGetUpdatedAtRetType = time.Time - -func getKeypairGetUpdatedAtAttributeTypeOk(arg KeypairGetUpdatedAtAttributeType) (ret KeypairGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKeypairGetUpdatedAtAttributeType(arg *KeypairGetUpdatedAtAttributeType, val KeypairGetUpdatedAtRetType) { - *arg = &val -} - -// Keypair Object that represents the public key of an SSH keypair and its name. -type Keypair struct { - // Date-time when resource was created. - CreatedAt KeypairGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Object that represents an SSH keypair MD5 fingerprint. - Fingerprint KeypairGetFingerprintAttributeType `json:"fingerprint,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels KeypairGetLabelsAttributeType `json:"labels,omitempty"` - // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - Name KeypairGetNameAttributeType `json:"name,omitempty"` - // Object that represents a public SSH key. - // REQUIRED - PublicKey KeypairGetPublicKeyAttributeType `json:"publicKey" required:"true"` - // Date-time when resource was last updated. - UpdatedAt KeypairGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _Keypair Keypair - -// NewKeypair instantiates a new Keypair 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 NewKeypair(publicKey KeypairGetPublicKeyArgType) *Keypair { - this := Keypair{} - setKeypairGetPublicKeyAttributeType(&this.PublicKey, publicKey) - return &this -} - -// NewKeypairWithDefaults instantiates a new Keypair 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 NewKeypairWithDefaults() *Keypair { - this := Keypair{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Keypair) GetCreatedAt() (res KeypairGetCreatedAtRetType) { - 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 *Keypair) GetCreatedAtOk() (ret KeypairGetCreatedAtRetType, ok bool) { - return getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Keypair) 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 *Keypair) SetCreatedAt(v KeypairGetCreatedAtRetType) { - setKeypairGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. -func (o *Keypair) GetFingerprint() (res KeypairGetFingerprintRetType) { - res, _ = o.GetFingerprintOk() - return -} - -// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Keypair) GetFingerprintOk() (ret KeypairGetFingerprintRetType, ok bool) { - return getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint) -} - -// HasFingerprint returns a boolean if a field has been set. -func (o *Keypair) HasFingerprint() bool { - _, ok := o.GetFingerprintOk() - return ok -} - -// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. -func (o *Keypair) SetFingerprint(v KeypairGetFingerprintRetType) { - setKeypairGetFingerprintAttributeType(&o.Fingerprint, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Keypair) GetLabels() (res KeypairGetLabelsRetType) { - 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 *Keypair) GetLabelsOk() (ret KeypairGetLabelsRetType, ok bool) { - return getKeypairGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Keypair) 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 *Keypair) SetLabels(v KeypairGetLabelsRetType) { - setKeypairGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Keypair) GetName() (res KeypairGetNameRetType) { - 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 *Keypair) GetNameOk() (ret KeypairGetNameRetType, ok bool) { - return getKeypairGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *Keypair) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Keypair) SetName(v KeypairGetNameRetType) { - setKeypairGetNameAttributeType(&o.Name, v) -} - -// GetPublicKey returns the PublicKey field value -func (o *Keypair) GetPublicKey() (ret KeypairGetPublicKeyRetType) { - ret, _ = o.GetPublicKeyOk() - return ret -} - -// GetPublicKeyOk returns a tuple with the PublicKey field value -// and a boolean to check if the value has been set. -func (o *Keypair) GetPublicKeyOk() (ret KeypairGetPublicKeyRetType, ok bool) { - return getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey) -} - -// SetPublicKey sets field value -func (o *Keypair) SetPublicKey(v KeypairGetPublicKeyRetType) { - setKeypairGetPublicKeyAttributeType(&o.PublicKey, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Keypair) GetUpdatedAt() (res KeypairGetUpdatedAtRetType) { - 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 *Keypair) GetUpdatedAtOk() (ret KeypairGetUpdatedAtRetType, ok bool) { - return getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Keypair) 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 *Keypair) SetUpdatedAt(v KeypairGetUpdatedAtRetType) { - setKeypairGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o Keypair) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint); ok { - toSerialize["Fingerprint"] = val - } - if val, ok := getKeypairGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getKeypairGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey); ok { - toSerialize["PublicKey"] = val - } - if val, ok := getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableKeypair struct { - value *Keypair - isSet bool -} - -func (v NullableKeypair) Get() *Keypair { - return v.value -} - -func (v *NullableKeypair) Set(val *Keypair) { - v.value = val - v.isSet = true -} - -func (v NullableKeypair) IsSet() bool { - return v.isSet -} - -func (v *NullableKeypair) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeypair(val *Keypair) *NullableKeypair { - return &NullableKeypair{value: val, isSet: true} -} - -func (v NullableKeypair) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeypair) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_keypair_test.go b/services/iaasalpha/model_keypair_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_keypair_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_machine_type.go b/services/iaasalpha/model_machine_type.go deleted file mode 100644 index b59de8eb3..000000000 --- a/services/iaasalpha/model_machine_type.go +++ /dev/null @@ -1,356 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the MachineType type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &MachineType{} - -/* - types and functions for description -*/ - -// isNotNullableString -type MachineTypeGetDescriptionAttributeType = *string - -func getMachineTypeGetDescriptionAttributeTypeOk(arg MachineTypeGetDescriptionAttributeType) (ret MachineTypeGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetDescriptionAttributeType(arg *MachineTypeGetDescriptionAttributeType, val MachineTypeGetDescriptionRetType) { - *arg = &val -} - -type MachineTypeGetDescriptionArgType = string -type MachineTypeGetDescriptionRetType = string - -/* - types and functions for disk -*/ - -// isLong -type MachineTypeGetDiskAttributeType = *int64 -type MachineTypeGetDiskArgType = int64 -type MachineTypeGetDiskRetType = int64 - -func getMachineTypeGetDiskAttributeTypeOk(arg MachineTypeGetDiskAttributeType) (ret MachineTypeGetDiskRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetDiskAttributeType(arg *MachineTypeGetDiskAttributeType, val MachineTypeGetDiskRetType) { - *arg = &val -} - -/* - types and functions for extraSpecs -*/ - -// isFreeform -type MachineTypeGetExtraSpecsAttributeType = *map[string]interface{} -type MachineTypeGetExtraSpecsArgType = map[string]interface{} -type MachineTypeGetExtraSpecsRetType = map[string]interface{} - -func getMachineTypeGetExtraSpecsAttributeTypeOk(arg MachineTypeGetExtraSpecsAttributeType) (ret MachineTypeGetExtraSpecsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetExtraSpecsAttributeType(arg *MachineTypeGetExtraSpecsAttributeType, val MachineTypeGetExtraSpecsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type MachineTypeGetNameAttributeType = *string - -func getMachineTypeGetNameAttributeTypeOk(arg MachineTypeGetNameAttributeType) (ret MachineTypeGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetNameAttributeType(arg *MachineTypeGetNameAttributeType, val MachineTypeGetNameRetType) { - *arg = &val -} - -type MachineTypeGetNameArgType = string -type MachineTypeGetNameRetType = string - -/* - types and functions for ram -*/ - -// isLong -type MachineTypeGetRamAttributeType = *int64 -type MachineTypeGetRamArgType = int64 -type MachineTypeGetRamRetType = int64 - -func getMachineTypeGetRamAttributeTypeOk(arg MachineTypeGetRamAttributeType) (ret MachineTypeGetRamRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetRamAttributeType(arg *MachineTypeGetRamAttributeType, val MachineTypeGetRamRetType) { - *arg = &val -} - -/* - types and functions for vcpus -*/ - -// isLong -type MachineTypeGetVcpusAttributeType = *int64 -type MachineTypeGetVcpusArgType = int64 -type MachineTypeGetVcpusRetType = int64 - -func getMachineTypeGetVcpusAttributeTypeOk(arg MachineTypeGetVcpusAttributeType) (ret MachineTypeGetVcpusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeGetVcpusAttributeType(arg *MachineTypeGetVcpusAttributeType, val MachineTypeGetVcpusRetType) { - *arg = &val -} - -// MachineType Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. -type MachineType struct { - // Description Object. Allows string up to 255 Characters. - Description MachineTypeGetDescriptionAttributeType `json:"description,omitempty"` - // Size in Gigabyte. - // REQUIRED - Disk MachineTypeGetDiskAttributeType `json:"disk" required:"true"` - // Properties to control certain aspects or scheduling behavior for an object. - ExtraSpecs MachineTypeGetExtraSpecsAttributeType `json:"extraSpecs,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name MachineTypeGetNameAttributeType `json:"name" required:"true"` - // Size in Megabyte. - // REQUIRED - Ram MachineTypeGetRamAttributeType `json:"ram" required:"true"` - // The number of virtual CPUs of a server. - // REQUIRED - Vcpus MachineTypeGetVcpusAttributeType `json:"vcpus" required:"true"` -} - -type _MachineType MachineType - -// NewMachineType instantiates a new MachineType 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 NewMachineType(disk MachineTypeGetDiskArgType, name MachineTypeGetNameArgType, ram MachineTypeGetRamArgType, vcpus MachineTypeGetVcpusArgType) *MachineType { - this := MachineType{} - setMachineTypeGetDiskAttributeType(&this.Disk, disk) - setMachineTypeGetNameAttributeType(&this.Name, name) - setMachineTypeGetRamAttributeType(&this.Ram, ram) - setMachineTypeGetVcpusAttributeType(&this.Vcpus, vcpus) - return &this -} - -// NewMachineTypeWithDefaults instantiates a new MachineType 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 NewMachineTypeWithDefaults() *MachineType { - this := MachineType{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *MachineType) GetDescription() (res MachineTypeGetDescriptionRetType) { - 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 *MachineType) GetDescriptionOk() (ret MachineTypeGetDescriptionRetType, ok bool) { - return getMachineTypeGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *MachineType) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *MachineType) SetDescription(v MachineTypeGetDescriptionRetType) { - setMachineTypeGetDescriptionAttributeType(&o.Description, v) -} - -// GetDisk returns the Disk field value -func (o *MachineType) GetDisk() (ret MachineTypeGetDiskRetType) { - ret, _ = o.GetDiskOk() - return ret -} - -// GetDiskOk returns a tuple with the Disk field value -// and a boolean to check if the value has been set. -func (o *MachineType) GetDiskOk() (ret MachineTypeGetDiskRetType, ok bool) { - return getMachineTypeGetDiskAttributeTypeOk(o.Disk) -} - -// SetDisk sets field value -func (o *MachineType) SetDisk(v MachineTypeGetDiskRetType) { - setMachineTypeGetDiskAttributeType(&o.Disk, v) -} - -// GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. -func (o *MachineType) GetExtraSpecs() (res MachineTypeGetExtraSpecsRetType) { - res, _ = o.GetExtraSpecsOk() - return -} - -// GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MachineType) GetExtraSpecsOk() (ret MachineTypeGetExtraSpecsRetType, ok bool) { - return getMachineTypeGetExtraSpecsAttributeTypeOk(o.ExtraSpecs) -} - -// HasExtraSpecs returns a boolean if a field has been set. -func (o *MachineType) HasExtraSpecs() bool { - _, ok := o.GetExtraSpecsOk() - return ok -} - -// SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. -func (o *MachineType) SetExtraSpecs(v MachineTypeGetExtraSpecsRetType) { - setMachineTypeGetExtraSpecsAttributeType(&o.ExtraSpecs, v) -} - -// GetName returns the Name field value -func (o *MachineType) GetName() (ret MachineTypeGetNameRetType) { - 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 *MachineType) GetNameOk() (ret MachineTypeGetNameRetType, ok bool) { - return getMachineTypeGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *MachineType) SetName(v MachineTypeGetNameRetType) { - setMachineTypeGetNameAttributeType(&o.Name, v) -} - -// GetRam returns the Ram field value -func (o *MachineType) GetRam() (ret MachineTypeGetRamRetType) { - ret, _ = o.GetRamOk() - return ret -} - -// GetRamOk returns a tuple with the Ram field value -// and a boolean to check if the value has been set. -func (o *MachineType) GetRamOk() (ret MachineTypeGetRamRetType, ok bool) { - return getMachineTypeGetRamAttributeTypeOk(o.Ram) -} - -// SetRam sets field value -func (o *MachineType) SetRam(v MachineTypeGetRamRetType) { - setMachineTypeGetRamAttributeType(&o.Ram, v) -} - -// GetVcpus returns the Vcpus field value -func (o *MachineType) GetVcpus() (ret MachineTypeGetVcpusRetType) { - ret, _ = o.GetVcpusOk() - return ret -} - -// GetVcpusOk returns a tuple with the Vcpus field value -// and a boolean to check if the value has been set. -func (o *MachineType) GetVcpusOk() (ret MachineTypeGetVcpusRetType, ok bool) { - return getMachineTypeGetVcpusAttributeTypeOk(o.Vcpus) -} - -// SetVcpus sets field value -func (o *MachineType) SetVcpus(v MachineTypeGetVcpusRetType) { - setMachineTypeGetVcpusAttributeType(&o.Vcpus, v) -} - -func (o MachineType) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getMachineTypeGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getMachineTypeGetDiskAttributeTypeOk(o.Disk); ok { - toSerialize["Disk"] = val - } - if val, ok := getMachineTypeGetExtraSpecsAttributeTypeOk(o.ExtraSpecs); ok { - toSerialize["ExtraSpecs"] = val - } - if val, ok := getMachineTypeGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getMachineTypeGetRamAttributeTypeOk(o.Ram); ok { - toSerialize["Ram"] = val - } - if val, ok := getMachineTypeGetVcpusAttributeTypeOk(o.Vcpus); ok { - toSerialize["Vcpus"] = val - } - return toSerialize, nil -} - -type NullableMachineType struct { - value *MachineType - isSet bool -} - -func (v NullableMachineType) Get() *MachineType { - return v.value -} - -func (v *NullableMachineType) Set(val *MachineType) { - v.value = val - v.isSet = true -} - -func (v NullableMachineType) IsSet() bool { - return v.isSet -} - -func (v *NullableMachineType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMachineType(val *MachineType) *NullableMachineType { - return &NullableMachineType{value: val, isSet: true} -} - -func (v NullableMachineType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMachineType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_machine_type_list_response.go b/services/iaasalpha/model_machine_type_list_response.go deleted file mode 100644 index e39a4fdf7..000000000 --- a/services/iaasalpha/model_machine_type_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the MachineTypeListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &MachineTypeListResponse{} - -/* - types and functions for items -*/ - -// isArray -type MachineTypeListResponseGetItemsAttributeType = *[]MachineType -type MachineTypeListResponseGetItemsArgType = []MachineType -type MachineTypeListResponseGetItemsRetType = []MachineType - -func getMachineTypeListResponseGetItemsAttributeTypeOk(arg MachineTypeListResponseGetItemsAttributeType) (ret MachineTypeListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setMachineTypeListResponseGetItemsAttributeType(arg *MachineTypeListResponseGetItemsAttributeType, val MachineTypeListResponseGetItemsRetType) { - *arg = &val -} - -// MachineTypeListResponse Machine type list response. -type MachineTypeListResponse struct { - // Machine type list. - // REQUIRED - Items MachineTypeListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _MachineTypeListResponse MachineTypeListResponse - -// NewMachineTypeListResponse instantiates a new MachineTypeListResponse 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 NewMachineTypeListResponse(items MachineTypeListResponseGetItemsArgType) *MachineTypeListResponse { - this := MachineTypeListResponse{} - setMachineTypeListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewMachineTypeListResponseWithDefaults instantiates a new MachineTypeListResponse 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 NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { - this := MachineTypeListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *MachineTypeListResponse) GetItems() (ret MachineTypeListResponseGetItemsRetType) { - 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 *MachineTypeListResponse) GetItemsOk() (ret MachineTypeListResponseGetItemsRetType, ok bool) { - return getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *MachineTypeListResponse) SetItems(v MachineTypeListResponseGetItemsRetType) { - setMachineTypeListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableMachineTypeListResponse struct { - value *MachineTypeListResponse - isSet bool -} - -func (v NullableMachineTypeListResponse) Get() *MachineTypeListResponse { - return v.value -} - -func (v *NullableMachineTypeListResponse) Set(val *MachineTypeListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableMachineTypeListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableMachineTypeListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMachineTypeListResponse(val *MachineTypeListResponse) *NullableMachineTypeListResponse { - return &NullableMachineTypeListResponse{value: val, isSet: true} -} - -func (v NullableMachineTypeListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMachineTypeListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_machine_type_list_response_test.go b/services/iaasalpha/model_machine_type_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_machine_type_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_machine_type_test.go b/services/iaasalpha/model_machine_type_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_machine_type_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network.go b/services/iaasalpha/model_network.go index d350e467e..3f3bc74b7 100644 --- a/services/iaasalpha/model_network.go +++ b/services/iaasalpha/model_network.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -39,258 +39,168 @@ func setNetworkGetCreatedAtAttributeType(arg *NetworkGetCreatedAtAttributeType, } /* - 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 @@ -316,30 +226,22 @@ func setNetworkGetUpdatedAtAttributeType(arg *NetworkGetUpdatedAtAttributeType, type Network struct { // Date-time when resource was created. CreatedAt NetworkGetCreatedAtAttributeType `json:"createdAt,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: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. 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"` } @@ -350,11 +252,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 } @@ -389,72 +291,67 @@ func (o *Network) SetCreatedAt(v NetworkGetCreatedAtRetType) { setNetworkGetCreatedAtAttributeType(&o.CreatedAt, 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. @@ -497,138 +394,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() @@ -652,21 +417,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. @@ -697,11 +485,14 @@ func (o Network) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = 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 @@ -709,29 +500,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/iaasalpha/model_network_area.go b/services/iaasalpha/model_network_area.go deleted file mode 100644 index 977b6fda7..000000000 --- a/services/iaasalpha/model_network_area.go +++ /dev/null @@ -1,452 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// 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 -*/ - -// isDateTime -type NetworkAreaGetCreatedAtAttributeType = *time.Time -type NetworkAreaGetCreatedAtArgType = time.Time -type NetworkAreaGetCreatedAtRetType = time.Time - -func getNetworkAreaGetCreatedAtAttributeTypeOk(arg NetworkAreaGetCreatedAtAttributeType) (ret NetworkAreaGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttributeType, val NetworkAreaGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for ipv4 -*/ - -// isModel -type NetworkAreaGetIpv4AttributeType = *NetworkAreaIPv4 -type NetworkAreaGetIpv4ArgType = NetworkAreaIPv4 -type NetworkAreaGetIpv4RetType = NetworkAreaIPv4 - -func getNetworkAreaGetIpv4AttributeTypeOk(arg NetworkAreaGetIpv4AttributeType) (ret NetworkAreaGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetIpv4AttributeType(arg *NetworkAreaGetIpv4AttributeType, val NetworkAreaGetIpv4RetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type NetworkAreaGetLabelsAttributeType = *map[string]interface{} -type NetworkAreaGetLabelsArgType = map[string]interface{} -type NetworkAreaGetLabelsRetType = map[string]interface{} - -func getNetworkAreaGetLabelsAttributeTypeOk(arg NetworkAreaGetLabelsAttributeType) (ret NetworkAreaGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetLabelsAttributeType(arg *NetworkAreaGetLabelsAttributeType, val NetworkAreaGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type NetworkAreaGetNameAttributeType = *string - -func getNetworkAreaGetNameAttributeTypeOk(arg NetworkAreaGetNameAttributeType) (ret NetworkAreaGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetNameAttributeType(arg *NetworkAreaGetNameAttributeType, val NetworkAreaGetNameRetType) { - *arg = &val -} - -type NetworkAreaGetNameArgType = string -type NetworkAreaGetNameRetType = string - -/* - types and functions for projectCount -*/ - -// isLong -type NetworkAreaGetProjectCountAttributeType = *int64 -type NetworkAreaGetProjectCountArgType = int64 -type NetworkAreaGetProjectCountRetType = int64 - -func getNetworkAreaGetProjectCountAttributeTypeOk(arg NetworkAreaGetProjectCountAttributeType) (ret NetworkAreaGetProjectCountRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountAttributeType, val NetworkAreaGetProjectCountRetType) { - *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 -*/ - -// isDateTime -type NetworkAreaGetUpdatedAtAttributeType = *time.Time -type NetworkAreaGetUpdatedAtArgType = time.Time -type NetworkAreaGetUpdatedAtRetType = time.Time - -func getNetworkAreaGetUpdatedAtAttributeTypeOk(arg NetworkAreaGetUpdatedAtAttributeType) (ret NetworkAreaGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetUpdatedAtAttributeType(arg *NetworkAreaGetUpdatedAtAttributeType, val NetworkAreaGetUpdatedAtRetType) { - *arg = &val -} - -// 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"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - 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"` - // Date-time when resource was last updated. - UpdatedAt NetworkAreaGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _NetworkArea NetworkArea - -// NewNetworkArea instantiates a new NetworkArea 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 NewNetworkArea(areaId NetworkAreaGetAreaIdArgType, name NetworkAreaGetNameArgType, projectCount NetworkAreaGetProjectCountArgType, state NetworkAreaGetStateArgType) *NetworkArea { - this := NetworkArea{} - setNetworkAreaGetAreaIdAttributeType(&this.AreaId, areaId) - setNetworkAreaGetNameAttributeType(&this.Name, name) - setNetworkAreaGetProjectCountAttributeType(&this.ProjectCount, projectCount) - setNetworkAreaGetStateAttributeType(&this.State, state) - return &this -} - -// NewNetworkAreaWithDefaults instantiates a new NetworkArea 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 NewNetworkAreaWithDefaults() *NetworkArea { - this := 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() - 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 *NetworkArea) GetCreatedAtOk() (ret NetworkAreaGetCreatedAtRetType, ok bool) { - return getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *NetworkArea) 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 *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() - 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 *NetworkArea) GetIpv4Ok() (ret NetworkAreaGetIpv4RetType, ok bool) { - return getNetworkAreaGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *NetworkArea) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - 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) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *NetworkArea) GetLabels() (res NetworkAreaGetLabelsRetType) { - 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 *NetworkArea) GetLabelsOk() (ret NetworkAreaGetLabelsRetType, ok bool) { - return getNetworkAreaGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *NetworkArea) 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 *NetworkArea) SetLabels(v NetworkAreaGetLabelsRetType) { - setNetworkAreaGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value -func (o *NetworkArea) GetName() (ret NetworkAreaGetNameRetType) { - 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 *NetworkArea) GetNameOk() (ret NetworkAreaGetNameRetType, ok bool) { - return getNetworkAreaGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -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 -} - -// GetProjectCountOk returns a tuple with the ProjectCount field value -// 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) -} - -// SetState sets field value -func (o *NetworkArea) SetState(v NetworkAreaGetStateRetType) { - setNetworkAreaGetStateAttributeType(&o.State, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *NetworkArea) GetUpdatedAt() (res NetworkAreaGetUpdatedAtRetType) { - 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 *NetworkArea) GetUpdatedAtOk() (ret NetworkAreaGetUpdatedAtRetType, ok bool) { - return getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *NetworkArea) 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 *NetworkArea) SetUpdatedAt(v NetworkAreaGetUpdatedAtRetType) { - setNetworkAreaGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -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 := getNetworkAreaGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getNetworkAreaGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - 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 - } - return toSerialize, nil -} - -type NullableNetworkArea struct { - value *NetworkArea - isSet bool -} - -func (v NullableNetworkArea) Get() *NetworkArea { - return v.value -} - -func (v *NullableNetworkArea) Set(val *NetworkArea) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkArea) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkArea) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea { - return &NullableNetworkArea{value: val, isSet: true} -} - -func (v NullableNetworkArea) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_network_area_ipv4.go b/services/iaasalpha/model_network_area_ipv4.go deleted file mode 100644 index d49b9d799..000000000 --- a/services/iaasalpha/model_network_area_ipv4.go +++ /dev/null @@ -1,423 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the NetworkAreaIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkAreaIPv4{} - -/* - types and functions for defaultNameservers -*/ - -// isArray -type NetworkAreaIPv4GetDefaultNameserversAttributeType = *[]string -type NetworkAreaIPv4GetDefaultNameserversArgType = []string -type NetworkAreaIPv4GetDefaultNameserversRetType = []string - -func getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(arg NetworkAreaIPv4GetDefaultNameserversAttributeType) (ret NetworkAreaIPv4GetDefaultNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetDefaultNameserversAttributeType(arg *NetworkAreaIPv4GetDefaultNameserversAttributeType, val NetworkAreaIPv4GetDefaultNameserversRetType) { - *arg = &val -} - -/* - types and functions for networkRanges -*/ - -// isArray -type NetworkAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange -type NetworkAreaIPv4GetNetworkRangesArgType = []NetworkRange -type NetworkAreaIPv4GetNetworkRangesRetType = []NetworkRange - -func getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(arg NetworkAreaIPv4GetNetworkRangesAttributeType) (ret NetworkAreaIPv4GetNetworkRangesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetNetworkRangesAttributeType(arg *NetworkAreaIPv4GetNetworkRangesAttributeType, val NetworkAreaIPv4GetNetworkRangesRetType) { - *arg = &val -} - -/* - types and functions for routes -*/ - -// isArray -type NetworkAreaIPv4GetRoutesAttributeType = *[]Route -type NetworkAreaIPv4GetRoutesArgType = []Route -type NetworkAreaIPv4GetRoutesRetType = []Route - -func getNetworkAreaIPv4GetRoutesAttributeTypeOk(arg NetworkAreaIPv4GetRoutesAttributeType) (ret NetworkAreaIPv4GetRoutesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetRoutesAttributeType(arg *NetworkAreaIPv4GetRoutesAttributeType, val NetworkAreaIPv4GetRoutesRetType) { - *arg = &val -} - -/* - types and functions for transferNetwork -*/ - -// isNotNullableString -type NetworkAreaIPv4GetTransferNetworkAttributeType = *string - -func getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(arg NetworkAreaIPv4GetTransferNetworkAttributeType) (ret NetworkAreaIPv4GetTransferNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetTransferNetworkAttributeType(arg *NetworkAreaIPv4GetTransferNetworkAttributeType, val NetworkAreaIPv4GetTransferNetworkRetType) { - *arg = &val -} - -type NetworkAreaIPv4GetTransferNetworkArgType = string -type NetworkAreaIPv4GetTransferNetworkRetType = string - -/* - types and functions for defaultPrefixLen -*/ - -// isInteger -type NetworkAreaIPv4GetDefaultPrefixLenAttributeType = *int64 -type NetworkAreaIPv4GetDefaultPrefixLenArgType = int64 -type NetworkAreaIPv4GetDefaultPrefixLenRetType = int64 - -func getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetDefaultPrefixLenAttributeType) (ret NetworkAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetDefaultPrefixLenAttributeType(arg *NetworkAreaIPv4GetDefaultPrefixLenAttributeType, val NetworkAreaIPv4GetDefaultPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for maxPrefixLen -*/ - -// isInteger -type NetworkAreaIPv4GetMaxPrefixLenAttributeType = *int64 -type NetworkAreaIPv4GetMaxPrefixLenArgType = int64 -type NetworkAreaIPv4GetMaxPrefixLenRetType = int64 - -func getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetMaxPrefixLenAttributeType) (ret NetworkAreaIPv4GetMaxPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetMaxPrefixLenAttributeType(arg *NetworkAreaIPv4GetMaxPrefixLenAttributeType, val NetworkAreaIPv4GetMaxPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for minPrefixLen -*/ - -// isInteger -type NetworkAreaIPv4GetMinPrefixLenAttributeType = *int64 -type NetworkAreaIPv4GetMinPrefixLenArgType = int64 -type NetworkAreaIPv4GetMinPrefixLenRetType = int64 - -func getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetMinPrefixLenAttributeType) (ret NetworkAreaIPv4GetMinPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaIPv4GetMinPrefixLenAttributeType(arg *NetworkAreaIPv4GetMinPrefixLenAttributeType, val NetworkAreaIPv4GetMinPrefixLenRetType) { - *arg = &val -} - -// NetworkAreaIPv4 The IPv4 properties of a network area. -type NetworkAreaIPv4 struct { - // A list containing DNS Servers/Nameservers for IPv4. - DefaultNameservers NetworkAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` - // A list of network ranges. - NetworkRanges NetworkAreaIPv4GetNetworkRangesAttributeType `json:"networkRanges,omitempty"` - // A list of routes. - Routes NetworkAreaIPv4GetRoutesAttributeType `json:"routes,omitempty"` - // Classless Inter-Domain Routing (CIDR). - TransferNetwork NetworkAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork,omitempty"` - // The default prefix length for networks in the network area. - DefaultPrefixLen NetworkAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` - // The maximal prefix length for networks in the network area. - MaxPrefixLen NetworkAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for networks in the network area. - MinPrefixLen NetworkAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` -} - -// NewNetworkAreaIPv4 instantiates a new NetworkAreaIPv4 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 NewNetworkAreaIPv4() *NetworkAreaIPv4 { - this := NetworkAreaIPv4{} - return &this -} - -// NewNetworkAreaIPv4WithDefaults instantiates a new NetworkAreaIPv4 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 NewNetworkAreaIPv4WithDefaults() *NetworkAreaIPv4 { - this := NetworkAreaIPv4{} - 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 *NetworkAreaIPv4) GetDefaultNameservers() (res NetworkAreaIPv4GetDefaultNameserversRetType) { - 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 *NetworkAreaIPv4) GetDefaultNameserversOk() (ret NetworkAreaIPv4GetDefaultNameserversRetType, ok bool) { - return getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) -} - -// HasDefaultNameservers returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasDefaultNameservers() bool { - _, ok := o.GetDefaultNameserversOk() - return ok -} - -// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *NetworkAreaIPv4) SetDefaultNameservers(v NetworkAreaIPv4GetDefaultNameserversRetType) { - setNetworkAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) -} - -// GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetNetworkRanges() (res NetworkAreaIPv4GetNetworkRangesRetType) { - res, _ = o.GetNetworkRangesOk() - return -} - -// GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetNetworkRangesOk() (ret NetworkAreaIPv4GetNetworkRangesRetType, ok bool) { - return getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) -} - -// HasNetworkRanges returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasNetworkRanges() bool { - _, ok := o.GetNetworkRangesOk() - return ok -} - -// SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. -func (o *NetworkAreaIPv4) SetNetworkRanges(v NetworkAreaIPv4GetNetworkRangesRetType) { - setNetworkAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) -} - -// GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetRoutes() (res NetworkAreaIPv4GetRoutesRetType) { - res, _ = o.GetRoutesOk() - return -} - -// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetRoutesOk() (ret NetworkAreaIPv4GetRoutesRetType, ok bool) { - return getNetworkAreaIPv4GetRoutesAttributeTypeOk(o.Routes) -} - -// HasRoutes returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasRoutes() bool { - _, ok := o.GetRoutesOk() - return ok -} - -// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *NetworkAreaIPv4) SetRoutes(v NetworkAreaIPv4GetRoutesRetType) { - setNetworkAreaIPv4GetRoutesAttributeType(&o.Routes, v) -} - -// GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetTransferNetwork() (res NetworkAreaIPv4GetTransferNetworkRetType) { - res, _ = o.GetTransferNetworkOk() - return -} - -// GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetTransferNetworkOk() (ret NetworkAreaIPv4GetTransferNetworkRetType, ok bool) { - return getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) -} - -// HasTransferNetwork returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasTransferNetwork() bool { - _, ok := o.GetTransferNetworkOk() - return ok -} - -// SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. -func (o *NetworkAreaIPv4) SetTransferNetwork(v NetworkAreaIPv4GetTransferNetworkRetType) { - setNetworkAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetDefaultPrefixLen() (res NetworkAreaIPv4GetDefaultPrefixLenRetType) { - 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 *NetworkAreaIPv4) GetDefaultPrefixLenOk() (ret NetworkAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - return getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasDefaultPrefixLen() bool { - _, ok := o.GetDefaultPrefixLenOk() - return ok -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *NetworkAreaIPv4) SetDefaultPrefixLen(v NetworkAreaIPv4GetDefaultPrefixLenRetType) { - setNetworkAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetMaxPrefixLen() (res NetworkAreaIPv4GetMaxPrefixLenRetType) { - 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 *NetworkAreaIPv4) GetMaxPrefixLenOk() (ret NetworkAreaIPv4GetMaxPrefixLenRetType, ok bool) { - return getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasMaxPrefixLen() bool { - _, ok := o.GetMaxPrefixLenOk() - return ok -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *NetworkAreaIPv4) SetMaxPrefixLen(v NetworkAreaIPv4GetMaxPrefixLenRetType) { - setNetworkAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetMinPrefixLen() (res NetworkAreaIPv4GetMinPrefixLenRetType) { - 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 *NetworkAreaIPv4) GetMinPrefixLenOk() (ret NetworkAreaIPv4GetMinPrefixLenRetType, ok bool) { - return getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *NetworkAreaIPv4) HasMinPrefixLen() bool { - _, ok := o.GetMinPrefixLenOk() - return ok -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *NetworkAreaIPv4) SetMinPrefixLen(v NetworkAreaIPv4GetMinPrefixLenRetType) { - setNetworkAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) -} - -func (o NetworkAreaIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { - toSerialize["DefaultNameservers"] = val - } - if val, ok := getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { - toSerialize["NetworkRanges"] = val - } - if val, ok := getNetworkAreaIPv4GetRoutesAttributeTypeOk(o.Routes); ok { - toSerialize["Routes"] = val - } - if val, ok := getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { - toSerialize["TransferNetwork"] = val - } - if val, ok := getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { - toSerialize["DefaultPrefixLen"] = val - } - if val, ok := getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { - toSerialize["MaxPrefixLen"] = val - } - if val, ok := getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { - toSerialize["MinPrefixLen"] = val - } - return toSerialize, nil -} - -type NullableNetworkAreaIPv4 struct { - value *NetworkAreaIPv4 - isSet bool -} - -func (v NullableNetworkAreaIPv4) Get() *NetworkAreaIPv4 { - return v.value -} - -func (v *NullableNetworkAreaIPv4) Set(val *NetworkAreaIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkAreaIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkAreaIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkAreaIPv4(val *NetworkAreaIPv4) *NullableNetworkAreaIPv4 { - return &NullableNetworkAreaIPv4{value: val, isSet: true} -} - -func (v NullableNetworkAreaIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkAreaIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_network_area_ipv4_test.go b/services/iaasalpha/model_network_area_ipv4_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_network_area_ipv4_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network_area_list_response.go b/services/iaasalpha/model_network_area_list_response.go deleted file mode 100644 index dec521c7c..000000000 --- a/services/iaasalpha/model_network_area_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the NetworkAreaListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkAreaListResponse{} - -/* - types and functions for items -*/ - -// isArray -type NetworkAreaListResponseGetItemsAttributeType = *[]NetworkArea -type NetworkAreaListResponseGetItemsArgType = []NetworkArea -type NetworkAreaListResponseGetItemsRetType = []NetworkArea - -func getNetworkAreaListResponseGetItemsAttributeTypeOk(arg NetworkAreaListResponseGetItemsAttributeType) (ret NetworkAreaListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaListResponseGetItemsAttributeType(arg *NetworkAreaListResponseGetItemsAttributeType, val NetworkAreaListResponseGetItemsRetType) { - *arg = &val -} - -// NetworkAreaListResponse Network area list response. -type NetworkAreaListResponse struct { - // A list of network areas. - // REQUIRED - Items NetworkAreaListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _NetworkAreaListResponse NetworkAreaListResponse - -// NewNetworkAreaListResponse instantiates a new NetworkAreaListResponse 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 NewNetworkAreaListResponse(items NetworkAreaListResponseGetItemsArgType) *NetworkAreaListResponse { - this := NetworkAreaListResponse{} - setNetworkAreaListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewNetworkAreaListResponseWithDefaults instantiates a new NetworkAreaListResponse 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 NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { - this := NetworkAreaListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *NetworkAreaListResponse) GetItems() (ret NetworkAreaListResponseGetItemsRetType) { - 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 *NetworkAreaListResponse) GetItemsOk() (ret NetworkAreaListResponseGetItemsRetType, ok bool) { - return getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *NetworkAreaListResponse) SetItems(v NetworkAreaListResponseGetItemsRetType) { - setNetworkAreaListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableNetworkAreaListResponse struct { - value *NetworkAreaListResponse - isSet bool -} - -func (v NullableNetworkAreaListResponse) Get() *NetworkAreaListResponse { - return v.value -} - -func (v *NullableNetworkAreaListResponse) Set(val *NetworkAreaListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkAreaListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkAreaListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkAreaListResponse(val *NetworkAreaListResponse) *NullableNetworkAreaListResponse { - return &NullableNetworkAreaListResponse{value: val, isSet: true} -} - -func (v NullableNetworkAreaListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkAreaListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_network_area_list_response_test.go b/services/iaasalpha/model_network_area_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_network_area_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network_area_test.go b/services/iaasalpha/model_network_area_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_network_area_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network_gateway_ipv4.go b/services/iaasalpha/model_network_gateway_ipv4.go new file mode 100644 index 000000000..25e8c707b --- /dev/null +++ b/services/iaasalpha/model_network_gateway_ipv4.go @@ -0,0 +1,80 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the NetworkGatewayIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkGatewayIPv4{} + +// NetworkGatewayIPv4 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. +type NetworkGatewayIPv4 struct { +} + +// NewNetworkGatewayIPv4 instantiates a new NetworkGatewayIPv4 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 NewNetworkGatewayIPv4() *NetworkGatewayIPv4 { + this := NetworkGatewayIPv4{} + return &this +} + +// NewNetworkGatewayIPv4WithDefaults instantiates a new NetworkGatewayIPv4 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 NewNetworkGatewayIPv4WithDefaults() *NetworkGatewayIPv4 { + this := NetworkGatewayIPv4{} + return &this +} + +func (o NetworkGatewayIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + return toSerialize, nil +} + +type NullableNetworkGatewayIPv4 struct { + value *NetworkGatewayIPv4 + isSet bool +} + +func (v NullableNetworkGatewayIPv4) Get() *NetworkGatewayIPv4 { + return v.value +} + +func (v *NullableNetworkGatewayIPv4) Set(val *NetworkGatewayIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkGatewayIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkGatewayIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkGatewayIPv4(val *NetworkGatewayIPv4) *NullableNetworkGatewayIPv4 { + return &NullableNetworkGatewayIPv4{value: val, isSet: true} +} + +func (v NullableNetworkGatewayIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkGatewayIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_network_gateway_ipv4_test.go b/services/iaasalpha/model_network_gateway_ipv4_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_network_gateway_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_network_gateway_ipv6.go b/services/iaasalpha/model_network_gateway_ipv6.go new file mode 100644 index 000000000..754aee566 --- /dev/null +++ b/services/iaasalpha/model_network_gateway_ipv6.go @@ -0,0 +1,80 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the NetworkGatewayIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkGatewayIPv6{} + +// NetworkGatewayIPv6 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. +type NetworkGatewayIPv6 struct { +} + +// NewNetworkGatewayIPv6 instantiates a new NetworkGatewayIPv6 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 NewNetworkGatewayIPv6() *NetworkGatewayIPv6 { + this := NetworkGatewayIPv6{} + return &this +} + +// NewNetworkGatewayIPv6WithDefaults instantiates a new NetworkGatewayIPv6 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 NewNetworkGatewayIPv6WithDefaults() *NetworkGatewayIPv6 { + this := NetworkGatewayIPv6{} + return &this +} + +func (o NetworkGatewayIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + return toSerialize, nil +} + +type NullableNetworkGatewayIPv6 struct { + value *NetworkGatewayIPv6 + isSet bool +} + +func (v NullableNetworkGatewayIPv6) Get() *NetworkGatewayIPv6 { + return v.value +} + +func (v *NullableNetworkGatewayIPv6) Set(val *NetworkGatewayIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkGatewayIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkGatewayIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkGatewayIPv6(val *NetworkGatewayIPv6) *NullableNetworkGatewayIPv6 { + return &NullableNetworkGatewayIPv6{value: val, isSet: true} +} + +func (v NullableNetworkGatewayIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkGatewayIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_network_gateway_ipv6_test.go b/services/iaasalpha/model_network_gateway_ipv6_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_network_gateway_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_network_ipv4.go b/services/iaasalpha/model_network_ipv4.go new file mode 100644 index 000000000..2a8046435 --- /dev/null +++ b/services/iaasalpha/model_network_ipv4.go @@ -0,0 +1,280 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv4{} + +/* + types and functions for gateway +*/ + +// isModel +type NetworkIPv4GetGatewayAttributeType = *NullableNetworkGatewayIPv4 +type NetworkIPv4GetGatewayArgType = *NullableNetworkGatewayIPv4 +type NetworkIPv4GetGatewayRetType = *NullableNetworkGatewayIPv4 + +func getNetworkIPv4GetGatewayAttributeTypeOk(arg NetworkIPv4GetGatewayAttributeType) (ret NetworkIPv4GetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setNetworkIPv4GetGatewayAttributeType(arg *NetworkIPv4GetGatewayAttributeType, val NetworkIPv4GetGatewayRetType) { + *arg = val +} + +/* + 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 { + 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 NetworkGatewayIPv4 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/iaasalpha/model_network_ipv4_test.go b/services/iaasalpha/model_network_ipv4_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_network_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_network_ipv6.go b/services/iaasalpha/model_network_ipv6.go new file mode 100644 index 000000000..a9058110e --- /dev/null +++ b/services/iaasalpha/model_network_ipv6.go @@ -0,0 +1,231 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv6{} + +/* + types and functions for gateway +*/ + +// isModel +type NetworkIPv6GetGatewayAttributeType = *NullableNetworkGatewayIPv6 +type NetworkIPv6GetGatewayArgType = *NullableNetworkGatewayIPv6 +type NetworkIPv6GetGatewayRetType = *NullableNetworkGatewayIPv6 + +func getNetworkIPv6GetGatewayAttributeTypeOk(arg NetworkIPv6GetGatewayAttributeType) (ret NetworkIPv6GetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setNetworkIPv6GetGatewayAttributeType(arg *NetworkIPv6GetGatewayAttributeType, val NetworkIPv6GetGatewayRetType) { + *arg = val +} + +/* + 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 { + 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 NetworkGatewayIPv6 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/iaasalpha/model_network_ipv6_test.go b/services/iaasalpha/model_network_ipv6_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_network_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_network_list_response.go b/services/iaasalpha/model_network_list_response.go index 1914844ed..6bdc691dc 100644 --- a/services/iaasalpha/model_network_list_response.go +++ b/services/iaasalpha/model_network_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_network_list_response_test.go b/services/iaasalpha/model_network_list_response_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_network_list_response_test.go +++ b/services/iaasalpha/model_network_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_network_range.go b/services/iaasalpha/model_network_range.go deleted file mode 100644 index 15954b3c0..000000000 --- a/services/iaasalpha/model_network_range.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the NetworkRange type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkRange{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type NetworkRangeGetCreatedAtAttributeType = *time.Time -type NetworkRangeGetCreatedAtArgType = time.Time -type NetworkRangeGetCreatedAtRetType = time.Time - -func getNetworkRangeGetCreatedAtAttributeTypeOk(arg NetworkRangeGetCreatedAtAttributeType) (ret NetworkRangeGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkRangeGetCreatedAtAttributeType(arg *NetworkRangeGetCreatedAtAttributeType, val NetworkRangeGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for networkRangeId -*/ - -// isNotNullableString -type NetworkRangeGetNetworkRangeIdAttributeType = *string - -func getNetworkRangeGetNetworkRangeIdAttributeTypeOk(arg NetworkRangeGetNetworkRangeIdAttributeType) (ret NetworkRangeGetNetworkRangeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkRangeGetNetworkRangeIdAttributeType(arg *NetworkRangeGetNetworkRangeIdAttributeType, val NetworkRangeGetNetworkRangeIdRetType) { - *arg = &val -} - -type NetworkRangeGetNetworkRangeIdArgType = string -type NetworkRangeGetNetworkRangeIdRetType = string - -/* - types and functions for prefix -*/ - -// isNotNullableString -type NetworkRangeGetPrefixAttributeType = *string - -func getNetworkRangeGetPrefixAttributeTypeOk(arg NetworkRangeGetPrefixAttributeType) (ret NetworkRangeGetPrefixRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkRangeGetPrefixAttributeType(arg *NetworkRangeGetPrefixAttributeType, val NetworkRangeGetPrefixRetType) { - *arg = &val -} - -type NetworkRangeGetPrefixArgType = string -type NetworkRangeGetPrefixRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type NetworkRangeGetUpdatedAtAttributeType = *time.Time -type NetworkRangeGetUpdatedAtArgType = time.Time -type NetworkRangeGetUpdatedAtRetType = time.Time - -func getNetworkRangeGetUpdatedAtAttributeTypeOk(arg NetworkRangeGetUpdatedAtAttributeType) (ret NetworkRangeGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkRangeGetUpdatedAtAttributeType(arg *NetworkRangeGetUpdatedAtAttributeType, val NetworkRangeGetUpdatedAtRetType) { - *arg = &val -} - -// NetworkRange Object that represents a network range. -type NetworkRange struct { - // Date-time when resource was created. - CreatedAt NetworkRangeGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - NetworkRangeId NetworkRangeGetNetworkRangeIdAttributeType `json:"networkRangeId,omitempty"` - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - Prefix NetworkRangeGetPrefixAttributeType `json:"prefix" required:"true"` - // Date-time when resource was last updated. - UpdatedAt NetworkRangeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _NetworkRange NetworkRange - -// NewNetworkRange instantiates a new NetworkRange 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 NewNetworkRange(prefix NetworkRangeGetPrefixArgType) *NetworkRange { - this := NetworkRange{} - setNetworkRangeGetPrefixAttributeType(&this.Prefix, prefix) - return &this -} - -// NewNetworkRangeWithDefaults instantiates a new NetworkRange 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 NewNetworkRangeWithDefaults() *NetworkRange { - this := NetworkRange{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *NetworkRange) GetCreatedAt() (res NetworkRangeGetCreatedAtRetType) { - 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 *NetworkRange) GetCreatedAtOk() (ret NetworkRangeGetCreatedAtRetType, ok bool) { - return getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *NetworkRange) 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 *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() - return -} - -// GetNetworkRangeIdOk returns a tuple with the NetworkRangeId 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) -} - -// HasNetworkRangeId returns a boolean if a field has been set. -func (o *NetworkRange) HasNetworkRangeId() bool { - _, ok := o.GetNetworkRangeIdOk() - 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) -} - -// GetPrefix returns the Prefix field value -func (o *NetworkRange) GetPrefix() (ret NetworkRangeGetPrefixRetType) { - 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 *NetworkRange) GetPrefixOk() (ret NetworkRangeGetPrefixRetType, ok bool) { - return getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix) -} - -// SetPrefix sets field value -func (o *NetworkRange) SetPrefix(v NetworkRangeGetPrefixRetType) { - setNetworkRangeGetPrefixAttributeType(&o.Prefix, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *NetworkRange) GetUpdatedAt() (res NetworkRangeGetUpdatedAtRetType) { - 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 *NetworkRange) GetUpdatedAtOk() (ret NetworkRangeGetUpdatedAtRetType, ok bool) { - return getNetworkRangeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *NetworkRange) 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 *NetworkRange) SetUpdatedAt(v NetworkRangeGetUpdatedAtRetType) { - setNetworkRangeGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o NetworkRange) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getNetworkRangeGetNetworkRangeIdAttributeTypeOk(o.NetworkRangeId); ok { - toSerialize["NetworkRangeId"] = val - } - if val, ok := getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix); ok { - toSerialize["Prefix"] = val - } - if val, ok := getNetworkRangeGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableNetworkRange struct { - value *NetworkRange - isSet bool -} - -func (v NullableNetworkRange) Get() *NetworkRange { - return v.value -} - -func (v *NullableNetworkRange) Set(val *NetworkRange) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkRange) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkRange) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkRange(val *NetworkRange) *NullableNetworkRange { - return &NullableNetworkRange{value: val, isSet: true} -} - -func (v NullableNetworkRange) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkRange) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_network_range_list_response.go b/services/iaasalpha/model_network_range_list_response.go deleted file mode 100644 index 9c1f24568..000000000 --- a/services/iaasalpha/model_network_range_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the NetworkRangeListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkRangeListResponse{} - -/* - types and functions for items -*/ - -// isArray -type NetworkRangeListResponseGetItemsAttributeType = *[]NetworkRange -type NetworkRangeListResponseGetItemsArgType = []NetworkRange -type NetworkRangeListResponseGetItemsRetType = []NetworkRange - -func getNetworkRangeListResponseGetItemsAttributeTypeOk(arg NetworkRangeListResponseGetItemsAttributeType) (ret NetworkRangeListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkRangeListResponseGetItemsAttributeType(arg *NetworkRangeListResponseGetItemsAttributeType, val NetworkRangeListResponseGetItemsRetType) { - *arg = &val -} - -// NetworkRangeListResponse Network Range list response. -type NetworkRangeListResponse struct { - // A list of network ranges. - // REQUIRED - Items NetworkRangeListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _NetworkRangeListResponse NetworkRangeListResponse - -// NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse 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 NewNetworkRangeListResponse(items NetworkRangeListResponseGetItemsArgType) *NetworkRangeListResponse { - this := NetworkRangeListResponse{} - setNetworkRangeListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse 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 NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { - this := NetworkRangeListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *NetworkRangeListResponse) GetItems() (ret NetworkRangeListResponseGetItemsRetType) { - 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 *NetworkRangeListResponse) GetItemsOk() (ret NetworkRangeListResponseGetItemsRetType, ok bool) { - return getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *NetworkRangeListResponse) SetItems(v NetworkRangeListResponseGetItemsRetType) { - setNetworkRangeListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableNetworkRangeListResponse struct { - value *NetworkRangeListResponse - isSet bool -} - -func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { - return v.value -} - -func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkRangeListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkRangeListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { - return &NullableNetworkRangeListResponse{value: val, isSet: true} -} - -func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_network_range_list_response_test.go b/services/iaasalpha/model_network_range_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_network_range_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network_range_test.go b/services/iaasalpha/model_network_range_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_network_range_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_network_test.go b/services/iaasalpha/model_network_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_network_test.go +++ b/services/iaasalpha/model_network_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_nexthop_blackhole.go b/services/iaasalpha/model_nexthop_blackhole.go new file mode 100644 index 000000000..aca12b147 --- /dev/null +++ b/services/iaasalpha/model_nexthop_blackhole.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_nexthop_blackhole_test.go b/services/iaasalpha/model_nexthop_blackhole_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_nexthop_blackhole_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_nexthop_internet.go b/services/iaasalpha/model_nexthop_internet.go new file mode 100644 index 000000000..e65324403 --- /dev/null +++ b/services/iaasalpha/model_nexthop_internet.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_nexthop_internet_test.go b/services/iaasalpha/model_nexthop_internet_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_nexthop_internet_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_nexthop_ipv4.go b/services/iaasalpha/model_nexthop_ipv4.go new file mode 100644 index 000000000..872c90f30 --- /dev/null +++ b/services/iaasalpha/model_nexthop_ipv4.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_nexthop_ipv4_test.go b/services/iaasalpha/model_nexthop_ipv4_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_nexthop_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_nexthop_ipv6.go b/services/iaasalpha/model_nexthop_ipv6.go new file mode 100644 index 000000000..20d7c0cf2 --- /dev/null +++ b/services/iaasalpha/model_nexthop_ipv6.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_nexthop_ipv6_test.go b/services/iaasalpha/model_nexthop_ipv6_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_nexthop_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_nic.go b/services/iaasalpha/model_nic.go deleted file mode 100644 index 3b1b256c8..000000000 --- a/services/iaasalpha/model_nic.go +++ /dev/null @@ -1,713 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the NIC type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NIC{} - -/* - types and functions for allowedAddresses -*/ - -// isArray -type NICGetAllowedAddressesAttributeType = *[]AllowedAddressesInner -type NICGetAllowedAddressesArgType = []AllowedAddressesInner -type NICGetAllowedAddressesRetType = []AllowedAddressesInner - -func getNICGetAllowedAddressesAttributeTypeOk(arg NICGetAllowedAddressesAttributeType) (ret NICGetAllowedAddressesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetAllowedAddressesAttributeType(arg *NICGetAllowedAddressesAttributeType, val NICGetAllowedAddressesRetType) { - *arg = &val -} - -/* - types and functions for device -*/ - -// isNotNullableString -type NICGetDeviceAttributeType = *string - -func getNICGetDeviceAttributeTypeOk(arg NICGetDeviceAttributeType) (ret NICGetDeviceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetDeviceAttributeType(arg *NICGetDeviceAttributeType, val NICGetDeviceRetType) { - *arg = &val -} - -type NICGetDeviceArgType = string -type NICGetDeviceRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type NICGetIdAttributeType = *string - -func getNICGetIdAttributeTypeOk(arg NICGetIdAttributeType) (ret NICGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetIdAttributeType(arg *NICGetIdAttributeType, val NICGetIdRetType) { - *arg = &val -} - -type NICGetIdArgType = string -type NICGetIdRetType = string - -/* - types and functions for ipv4 -*/ - -// isNotNullableString -type NICGetIpv4AttributeType = *string - -func getNICGetIpv4AttributeTypeOk(arg NICGetIpv4AttributeType) (ret NICGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetIpv4AttributeType(arg *NICGetIpv4AttributeType, val NICGetIpv4RetType) { - *arg = &val -} - -type NICGetIpv4ArgType = string -type NICGetIpv4RetType = string - -/* - types and functions for ipv6 -*/ - -// isNotNullableString -type NICGetIpv6AttributeType = *string - -func getNICGetIpv6AttributeTypeOk(arg NICGetIpv6AttributeType) (ret NICGetIpv6RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetIpv6AttributeType(arg *NICGetIpv6AttributeType, val NICGetIpv6RetType) { - *arg = &val -} - -type NICGetIpv6ArgType = string -type NICGetIpv6RetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type NICGetLabelsAttributeType = *map[string]interface{} -type NICGetLabelsArgType = map[string]interface{} -type NICGetLabelsRetType = map[string]interface{} - -func getNICGetLabelsAttributeTypeOk(arg NICGetLabelsAttributeType) (ret NICGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetLabelsAttributeType(arg *NICGetLabelsAttributeType, val NICGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for mac -*/ - -// isNotNullableString -type NICGetMacAttributeType = *string - -func getNICGetMacAttributeTypeOk(arg NICGetMacAttributeType) (ret NICGetMacRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetMacAttributeType(arg *NICGetMacAttributeType, val NICGetMacRetType) { - *arg = &val -} - -type NICGetMacArgType = string -type NICGetMacRetType = string - -/* - types and functions for name -*/ - -// isNotNullableString -type NICGetNameAttributeType = *string - -func getNICGetNameAttributeTypeOk(arg NICGetNameAttributeType) (ret NICGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetNameAttributeType(arg *NICGetNameAttributeType, val NICGetNameRetType) { - *arg = &val -} - -type NICGetNameArgType = string -type NICGetNameRetType = string - -/* - types and functions for networkId -*/ - -// isNotNullableString -type NICGetNetworkIdAttributeType = *string - -func getNICGetNetworkIdAttributeTypeOk(arg NICGetNetworkIdAttributeType) (ret NICGetNetworkIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetNetworkIdAttributeType(arg *NICGetNetworkIdAttributeType, val NICGetNetworkIdRetType) { - *arg = &val -} - -type NICGetNetworkIdArgType = string -type NICGetNetworkIdRetType = string - -/* - types and functions for nicSecurity -*/ - -// isBoolean -type NICgetNicSecurityAttributeType = *bool -type NICgetNicSecurityArgType = bool -type NICgetNicSecurityRetType = bool - -func getNICgetNicSecurityAttributeTypeOk(arg NICgetNicSecurityAttributeType) (ret NICgetNicSecurityRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICgetNicSecurityAttributeType(arg *NICgetNicSecurityAttributeType, val NICgetNicSecurityRetType) { - *arg = &val -} - -/* - types and functions for securityGroups -*/ - -// isArray -type NICGetSecurityGroupsAttributeType = *[]string -type NICGetSecurityGroupsArgType = []string -type NICGetSecurityGroupsRetType = []string - -func getNICGetSecurityGroupsAttributeTypeOk(arg NICGetSecurityGroupsAttributeType) (ret NICGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetSecurityGroupsAttributeType(arg *NICGetSecurityGroupsAttributeType, val NICGetSecurityGroupsRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type NICGetStatusAttributeType = *string - -func getNICGetStatusAttributeTypeOk(arg NICGetStatusAttributeType) (ret NICGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetStatusAttributeType(arg *NICGetStatusAttributeType, val NICGetStatusRetType) { - *arg = &val -} - -type NICGetStatusArgType = string -type NICGetStatusRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type NICGetTypeAttributeType = *string - -func getNICGetTypeAttributeTypeOk(arg NICGetTypeAttributeType) (ret NICGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICGetTypeAttributeType(arg *NICGetTypeAttributeType, val NICGetTypeRetType) { - *arg = &val -} - -type NICGetTypeArgType = string -type NICGetTypeRetType = string - -// NIC Object that represents a network interface. -type NIC struct { - // A list of IPs or CIDR notations. - AllowedAddresses NICGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` - // Universally Unique Identifier (UUID). - Device NICGetDeviceAttributeType `json:"device,omitempty"` - // Universally Unique Identifier (UUID). - Id NICGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ipv4 NICGetIpv4AttributeType `json:"ipv4,omitempty"` - // String that represents an IPv6 address. - Ipv6 NICGetIpv6AttributeType `json:"ipv6,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels NICGetLabelsAttributeType `json:"labels,omitempty"` - // Object that represents an MAC address. - Mac NICGetMacAttributeType `json:"mac,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name NICGetNameAttributeType `json:"name,omitempty"` - // Universally Unique Identifier (UUID). - NetworkId NICGetNetworkIdAttributeType `json:"networkId,omitempty"` - // If this is set to false, then no security groups will apply to this network interface. - NicSecurity NICgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` - // A list of UUIDs. - SecurityGroups NICGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` - Status NICGetStatusAttributeType `json:"status,omitempty"` - Type NICGetTypeAttributeType `json:"type,omitempty"` -} - -// NewNIC instantiates a new NIC 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 NewNIC() *NIC { - this := NIC{} - return &this -} - -// NewNICWithDefaults instantiates a new NIC 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 NewNICWithDefaults() *NIC { - this := NIC{} - var nicSecurity bool = true - this.NicSecurity = &nicSecurity - return &this -} - -// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *NIC) GetAllowedAddresses() (res NICGetAllowedAddressesRetType) { - res, _ = o.GetAllowedAddressesOk() - return -} - -// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetAllowedAddressesOk() (ret NICGetAllowedAddressesRetType, ok bool) { - return getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) -} - -// HasAllowedAddresses returns a boolean if a field has been set. -func (o *NIC) HasAllowedAddresses() bool { - _, ok := o.GetAllowedAddressesOk() - return ok -} - -// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *NIC) SetAllowedAddresses(v NICGetAllowedAddressesRetType) { - setNICGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) -} - -// GetDevice returns the Device field value if set, zero value otherwise. -func (o *NIC) GetDevice() (res NICGetDeviceRetType) { - res, _ = o.GetDeviceOk() - return -} - -// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetDeviceOk() (ret NICGetDeviceRetType, ok bool) { - return getNICGetDeviceAttributeTypeOk(o.Device) -} - -// HasDevice returns a boolean if a field has been set. -func (o *NIC) HasDevice() bool { - _, ok := o.GetDeviceOk() - return ok -} - -// SetDevice gets a reference to the given string and assigns it to the Device field. -func (o *NIC) SetDevice(v NICGetDeviceRetType) { - setNICGetDeviceAttributeType(&o.Device, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *NIC) GetId() (res NICGetIdRetType) { - 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 *NIC) GetIdOk() (ret NICGetIdRetType, ok bool) { - return getNICGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *NIC) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *NIC) SetId(v NICGetIdRetType) { - setNICGetIdAttributeType(&o.Id, v) -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *NIC) GetIpv4() (res NICGetIpv4RetType) { - 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 *NIC) GetIpv4Ok() (ret NICGetIpv4RetType, ok bool) { - return getNICGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *NIC) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *NIC) SetIpv4(v NICGetIpv4RetType) { - setNICGetIpv4AttributeType(&o.Ipv4, v) -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *NIC) GetIpv6() (res NICGetIpv6RetType) { - 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 *NIC) GetIpv6Ok() (ret NICGetIpv6RetType, ok bool) { - return getNICGetIpv6AttributeTypeOk(o.Ipv6) -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *NIC) HasIpv6() bool { - _, ok := o.GetIpv6Ok() - return ok -} - -// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *NIC) SetIpv6(v NICGetIpv6RetType) { - setNICGetIpv6AttributeType(&o.Ipv6, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *NIC) GetLabels() (res NICGetLabelsRetType) { - 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 *NIC) GetLabelsOk() (ret NICGetLabelsRetType, ok bool) { - return getNICGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *NIC) 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 *NIC) SetLabels(v NICGetLabelsRetType) { - setNICGetLabelsAttributeType(&o.Labels, v) -} - -// GetMac returns the Mac field value if set, zero value otherwise. -func (o *NIC) GetMac() (res NICGetMacRetType) { - res, _ = o.GetMacOk() - return -} - -// GetMacOk returns a tuple with the Mac field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetMacOk() (ret NICGetMacRetType, ok bool) { - return getNICGetMacAttributeTypeOk(o.Mac) -} - -// HasMac returns a boolean if a field has been set. -func (o *NIC) HasMac() bool { - _, ok := o.GetMacOk() - return ok -} - -// SetMac gets a reference to the given string and assigns it to the Mac field. -func (o *NIC) SetMac(v NICGetMacRetType) { - setNICGetMacAttributeType(&o.Mac, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *NIC) GetName() (res NICGetNameRetType) { - 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 *NIC) GetNameOk() (ret NICGetNameRetType, ok bool) { - return getNICGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *NIC) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *NIC) SetName(v NICGetNameRetType) { - setNICGetNameAttributeType(&o.Name, v) -} - -// GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *NIC) GetNetworkId() (res NICGetNetworkIdRetType) { - res, _ = o.GetNetworkIdOk() - return -} - -// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetNetworkIdOk() (ret NICGetNetworkIdRetType, ok bool) { - return getNICGetNetworkIdAttributeTypeOk(o.NetworkId) -} - -// HasNetworkId returns a boolean if a field has been set. -func (o *NIC) HasNetworkId() bool { - _, ok := o.GetNetworkIdOk() - return ok -} - -// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *NIC) SetNetworkId(v NICGetNetworkIdRetType) { - setNICGetNetworkIdAttributeType(&o.NetworkId, v) -} - -// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *NIC) GetNicSecurity() (res NICgetNicSecurityRetType) { - res, _ = o.GetNicSecurityOk() - return -} - -// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetNicSecurityOk() (ret NICgetNicSecurityRetType, ok bool) { - return getNICgetNicSecurityAttributeTypeOk(o.NicSecurity) -} - -// HasNicSecurity returns a boolean if a field has been set. -func (o *NIC) HasNicSecurity() bool { - _, ok := o.GetNicSecurityOk() - return ok -} - -// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *NIC) SetNicSecurity(v NICgetNicSecurityRetType) { - setNICgetNicSecurityAttributeType(&o.NicSecurity, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *NIC) GetSecurityGroups() (res NICGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetSecurityGroupsOk() (ret NICGetSecurityGroupsRetType, ok bool) { - return getNICGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *NIC) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *NIC) SetSecurityGroups(v NICGetSecurityGroupsRetType) { - setNICGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *NIC) GetStatus() (res NICGetStatusRetType) { - 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 *NIC) GetStatusOk() (ret NICGetStatusRetType, ok bool) { - return getNICGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *NIC) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *NIC) SetStatus(v NICGetStatusRetType) { - setNICGetStatusAttributeType(&o.Status, v) -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *NIC) GetType() (res NICGetTypeRetType) { - res, _ = o.GetTypeOk() - return -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NIC) GetTypeOk() (ret NICGetTypeRetType, ok bool) { - return getNICGetTypeAttributeTypeOk(o.Type) -} - -// HasType returns a boolean if a field has been set. -func (o *NIC) HasType() bool { - _, ok := o.GetTypeOk() - return ok -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *NIC) SetType(v NICGetTypeRetType) { - setNICGetTypeAttributeType(&o.Type, v) -} - -func (o NIC) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { - toSerialize["AllowedAddresses"] = val - } - if val, ok := getNICGetDeviceAttributeTypeOk(o.Device); ok { - toSerialize["Device"] = val - } - if val, ok := getNICGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getNICGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - if val, ok := getNICGetIpv6AttributeTypeOk(o.Ipv6); ok { - toSerialize["Ipv6"] = val - } - if val, ok := getNICGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getNICGetMacAttributeTypeOk(o.Mac); ok { - toSerialize["Mac"] = val - } - if val, ok := getNICGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getNICGetNetworkIdAttributeTypeOk(o.NetworkId); ok { - toSerialize["NetworkId"] = val - } - if val, ok := getNICgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { - toSerialize["NicSecurity"] = val - } - if val, ok := getNICGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - if val, ok := getNICGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getNICGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableNIC struct { - value *NIC - isSet bool -} - -func (v NullableNIC) Get() *NIC { - return v.value -} - -func (v *NullableNIC) Set(val *NIC) { - v.value = val - v.isSet = true -} - -func (v NullableNIC) IsSet() bool { - return v.isSet -} - -func (v *NullableNIC) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNIC(val *NIC) *NullableNIC { - return &NullableNIC{value: val, isSet: true} -} - -func (v NullableNIC) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNIC) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_nic_list_response.go b/services/iaasalpha/model_nic_list_response.go deleted file mode 100644 index bc439cfd9..000000000 --- a/services/iaasalpha/model_nic_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the NICListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NICListResponse{} - -/* - types and functions for items -*/ - -// isArray -type NICListResponseGetItemsAttributeType = *[]NIC -type NICListResponseGetItemsArgType = []NIC -type NICListResponseGetItemsRetType = []NIC - -func getNICListResponseGetItemsAttributeTypeOk(arg NICListResponseGetItemsAttributeType) (ret NICListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNICListResponseGetItemsAttributeType(arg *NICListResponseGetItemsAttributeType, val NICListResponseGetItemsRetType) { - *arg = &val -} - -// NICListResponse NIC list response. -type NICListResponse struct { - // A list of network interfaces. - // REQUIRED - Items NICListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _NICListResponse NICListResponse - -// NewNICListResponse instantiates a new NICListResponse 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 NewNICListResponse(items NICListResponseGetItemsArgType) *NICListResponse { - this := NICListResponse{} - setNICListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewNICListResponseWithDefaults instantiates a new NICListResponse 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 NewNICListResponseWithDefaults() *NICListResponse { - this := NICListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *NICListResponse) GetItems() (ret NICListResponseGetItemsRetType) { - 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 *NICListResponse) GetItemsOk() (ret NICListResponseGetItemsRetType, ok bool) { - return getNICListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *NICListResponse) SetItems(v NICListResponseGetItemsRetType) { - setNICListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o NICListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getNICListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableNICListResponse struct { - value *NICListResponse - isSet bool -} - -func (v NullableNICListResponse) Get() *NICListResponse { - return v.value -} - -func (v *NullableNICListResponse) Set(val *NICListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableNICListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableNICListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNICListResponse(val *NICListResponse) *NullableNICListResponse { - return &NullableNICListResponse{value: val, isSet: true} -} - -func (v NullableNICListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNICListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_nic_list_response_test.go b/services/iaasalpha/model_nic_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_nic_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_nic_test.go b/services/iaasalpha/model_nic_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_nic_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_partial_update_network_area_payload.go b/services/iaasalpha/model_partial_update_network_area_payload.go deleted file mode 100644 index 41fb914dc..000000000 --- a/services/iaasalpha/model_partial_update_network_area_payload.go +++ /dev/null @@ -1,224 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// 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 -*/ - -// isFreeform -type PartialUpdateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} -type PartialUpdateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} -type PartialUpdateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} - -func getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetLabelsAttributeType) (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(arg *PartialUpdateNetworkAreaPayloadGetLabelsAttributeType, val PartialUpdateNetworkAreaPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type PartialUpdateNetworkAreaPayloadGetNameAttributeType = *string - -func getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetNameAttributeType) (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPartialUpdateNetworkAreaPayloadGetNameAttributeType(arg *PartialUpdateNetworkAreaPayloadGetNameAttributeType, val PartialUpdateNetworkAreaPayloadGetNameRetType) { - *arg = &val -} - -type PartialUpdateNetworkAreaPayloadGetNameArgType = string -type PartialUpdateNetworkAreaPayloadGetNameRetType = string - -// PartialUpdateNetworkAreaPayload struct for PartialUpdateNetworkAreaPayload -type PartialUpdateNetworkAreaPayload struct { - AddressFamily PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels PartialUpdateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name PartialUpdateNetworkAreaPayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload 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 NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { - this := PartialUpdateNetworkAreaPayload{} - return &this -} - -// NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload 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 NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { - this := PartialUpdateNetworkAreaPayload{} - 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() - 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 *PartialUpdateNetworkAreaPayload) GetLabelsOk() (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { - return getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *PartialUpdateNetworkAreaPayload) 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 *PartialUpdateNetworkAreaPayload) SetLabels(v PartialUpdateNetworkAreaPayloadGetLabelsRetType) { - setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateNetworkAreaPayload) GetName() (res PartialUpdateNetworkAreaPayloadGetNameRetType) { - 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 *PartialUpdateNetworkAreaPayload) GetNameOk() (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { - return getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *PartialUpdateNetworkAreaPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *PartialUpdateNetworkAreaPayload) SetName(v PartialUpdateNetworkAreaPayloadGetNameRetType) { - setPartialUpdateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) -} - -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 - } - if val, ok := getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullablePartialUpdateNetworkAreaPayload struct { - value *PartialUpdateNetworkAreaPayload - isSet bool -} - -func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { - return v.value -} - -func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { - return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} -} - -func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_partial_update_network_area_payload_test.go b/services/iaasalpha/model_partial_update_network_area_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_partial_update_network_area_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_partial_update_network_payload.go b/services/iaasalpha/model_partial_update_network_payload.go index 3c86283aa..def06c90b 100644 --- a/services/iaasalpha/model_partial_update_network_payload.go +++ b/services/iaasalpha/model_partial_update_network_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,22 +18,42 @@ import ( var _ MappedNullable = &PartialUpdateNetworkPayload{} /* - types and functions for addressFamily + 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 ipv6 +*/ + +// isModel +type PartialUpdateNetworkPayloadGetIpv6AttributeType = *UpdateNetworkIPv6Body +type PartialUpdateNetworkPayloadGetIpv6ArgType = UpdateNetworkIPv6Body +type PartialUpdateNetworkPayloadGetIpv6RetType = UpdateNetworkIPv6Body + +func getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(arg PartialUpdateNetworkPayloadGetIpv6AttributeType) (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadGetIpv6AttributeType(arg *PartialUpdateNetworkPayloadGetIpv6AttributeType, val PartialUpdateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -98,15 +118,39 @@ 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"` + Ipv4 PartialUpdateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 PartialUpdateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. 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 @@ -126,27 +170,50 @@ 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() +// 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 } -// GetAddressFamilyOk returns a tuple with the AddressFamily 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. -func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (ret PartialUpdateNetworkPayloadGetAddressFamilyRetType, ok bool) { - return getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) +func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { + return getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) } -// HasAddressFamily returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasAddressFamily() bool { - _, ok := o.GetAddressFamilyOk() +// HasIpv6 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv6() bool { + _, ok := o.GetIpv6Ok() 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) +// 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. @@ -218,10 +285,36 @@ 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 := 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 @@ -232,6 +325,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/iaasalpha/model_partial_update_network_payload_test.go b/services/iaasalpha/model_partial_update_network_payload_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_partial_update_network_payload_test.go +++ b/services/iaasalpha/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: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_port_range.go b/services/iaasalpha/model_port_range.go deleted file mode 100644 index b66de6167..000000000 --- a/services/iaasalpha/model_port_range.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the PortRange type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PortRange{} - -/* - types and functions for max -*/ - -// isLong -type PortRangeGetMaxAttributeType = *int64 -type PortRangeGetMaxArgType = int64 -type PortRangeGetMaxRetType = int64 - -func getPortRangeGetMaxAttributeTypeOk(arg PortRangeGetMaxAttributeType) (ret PortRangeGetMaxRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPortRangeGetMaxAttributeType(arg *PortRangeGetMaxAttributeType, val PortRangeGetMaxRetType) { - *arg = &val -} - -/* - types and functions for min -*/ - -// isLong -type PortRangeGetMinAttributeType = *int64 -type PortRangeGetMinArgType = int64 -type PortRangeGetMinRetType = int64 - -func getPortRangeGetMinAttributeTypeOk(arg PortRangeGetMinAttributeType) (ret PortRangeGetMinRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPortRangeGetMinAttributeType(arg *PortRangeGetMinAttributeType, val PortRangeGetMinRetType) { - *arg = &val -} - -// PortRange Object that represents a range of ports. -type PortRange struct { - // The maximum port number. Should be greater or equal to the minimum. - // REQUIRED - Max PortRangeGetMaxAttributeType `json:"max" required:"true"` - // The minimum port number. Should be less or equal to the maximum. - // REQUIRED - Min PortRangeGetMinAttributeType `json:"min" required:"true"` -} - -type _PortRange PortRange - -// NewPortRange instantiates a new PortRange 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 NewPortRange(max PortRangeGetMaxArgType, min PortRangeGetMinArgType) *PortRange { - this := PortRange{} - setPortRangeGetMaxAttributeType(&this.Max, max) - setPortRangeGetMinAttributeType(&this.Min, min) - return &this -} - -// NewPortRangeWithDefaults instantiates a new PortRange 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 NewPortRangeWithDefaults() *PortRange { - this := PortRange{} - return &this -} - -// GetMax returns the Max field value -func (o *PortRange) GetMax() (ret PortRangeGetMaxRetType) { - ret, _ = o.GetMaxOk() - return ret -} - -// GetMaxOk returns a tuple with the Max field value -// and a boolean to check if the value has been set. -func (o *PortRange) GetMaxOk() (ret PortRangeGetMaxRetType, ok bool) { - return getPortRangeGetMaxAttributeTypeOk(o.Max) -} - -// SetMax sets field value -func (o *PortRange) SetMax(v PortRangeGetMaxRetType) { - setPortRangeGetMaxAttributeType(&o.Max, v) -} - -// GetMin returns the Min field value -func (o *PortRange) GetMin() (ret PortRangeGetMinRetType) { - ret, _ = o.GetMinOk() - return ret -} - -// GetMinOk returns a tuple with the Min field value -// and a boolean to check if the value has been set. -func (o *PortRange) GetMinOk() (ret PortRangeGetMinRetType, ok bool) { - return getPortRangeGetMinAttributeTypeOk(o.Min) -} - -// SetMin sets field value -func (o *PortRange) SetMin(v PortRangeGetMinRetType) { - setPortRangeGetMinAttributeType(&o.Min, v) -} - -func (o PortRange) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPortRangeGetMaxAttributeTypeOk(o.Max); ok { - toSerialize["Max"] = val - } - if val, ok := getPortRangeGetMinAttributeTypeOk(o.Min); ok { - toSerialize["Min"] = val - } - return toSerialize, nil -} - -type NullablePortRange struct { - value *PortRange - isSet bool -} - -func (v NullablePortRange) Get() *PortRange { - return v.value -} - -func (v *NullablePortRange) Set(val *PortRange) { - v.value = val - v.isSet = true -} - -func (v NullablePortRange) IsSet() bool { - return v.isSet -} - -func (v *NullablePortRange) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePortRange(val *PortRange) *NullablePortRange { - return &NullablePortRange{value: val, isSet: true} -} - -func (v NullablePortRange) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePortRange) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_port_range_test.go b/services/iaasalpha/model_port_range_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_port_range_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_project.go b/services/iaasalpha/model_project.go deleted file mode 100644 index a814a24dc..000000000 --- a/services/iaasalpha/model_project.go +++ /dev/null @@ -1,408 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Project type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Project{} - -/* - types and functions for areaId -*/ - -// isModel -type ProjectGetAreaIdAttributeType = *AreaId -type ProjectGetAreaIdArgType = AreaId -type ProjectGetAreaIdRetType = AreaId - -func getProjectGetAreaIdAttributeTypeOk(arg ProjectGetAreaIdAttributeType) (ret ProjectGetAreaIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetAreaIdAttributeType(arg *ProjectGetAreaIdAttributeType, val ProjectGetAreaIdRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type ProjectGetCreatedAtAttributeType = *time.Time -type ProjectGetCreatedAtArgType = time.Time -type ProjectGetCreatedAtRetType = time.Time - -func getProjectGetCreatedAtAttributeTypeOk(arg ProjectGetCreatedAtAttributeType) (ret ProjectGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetCreatedAtAttributeType(arg *ProjectGetCreatedAtAttributeType, val ProjectGetCreatedAtRetType) { - *arg = &val -} - -/* - 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 -*/ - -// isNotNullableString -type ProjectGetOpenstackProjectIdAttributeType = *string - -func getProjectGetOpenstackProjectIdAttributeTypeOk(arg ProjectGetOpenstackProjectIdAttributeType) (ret ProjectGetOpenstackProjectIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetOpenstackProjectIdAttributeType(arg *ProjectGetOpenstackProjectIdAttributeType, val ProjectGetOpenstackProjectIdRetType) { - *arg = &val -} - -type ProjectGetOpenstackProjectIdArgType = string -type ProjectGetOpenstackProjectIdRetType = string - -/* - types and functions for projectId -*/ - -// isNotNullableString -type ProjectGetProjectIdAttributeType = *string - -func getProjectGetProjectIdAttributeTypeOk(arg ProjectGetProjectIdAttributeType) (ret ProjectGetProjectIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetProjectIdAttributeType(arg *ProjectGetProjectIdAttributeType, val ProjectGetProjectIdRetType) { - *arg = &val -} - -type ProjectGetProjectIdArgType = string -type ProjectGetProjectIdRetType = string - -/* - types and functions for state -*/ - -// isNotNullableString -type ProjectGetStateAttributeType = *string - -func getProjectGetStateAttributeTypeOk(arg ProjectGetStateAttributeType) (ret ProjectGetStateRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetStateAttributeType(arg *ProjectGetStateAttributeType, val ProjectGetStateRetType) { - *arg = &val -} - -type ProjectGetStateArgType = string -type ProjectGetStateRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type ProjectGetUpdatedAtAttributeType = *time.Time -type ProjectGetUpdatedAtArgType = time.Time -type ProjectGetUpdatedAtRetType = time.Time - -func getProjectGetUpdatedAtAttributeTypeOk(arg ProjectGetUpdatedAtAttributeType) (ret ProjectGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectGetUpdatedAtAttributeType(arg *ProjectGetUpdatedAtAttributeType, val ProjectGetUpdatedAtRetType) { - *arg = &val -} - -// Project Object that represents a STACKIT project. -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"` - // Universally Unique Identifier (UUID). - // REQUIRED - ProjectId ProjectGetProjectIdAttributeType `json:"projectId" required:"true"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - // REQUIRED - State ProjectGetStateAttributeType `json:"state" required:"true"` - // Date-time when resource was last updated. - UpdatedAt ProjectGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _Project Project - -// NewProject instantiates a new Project 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 NewProject(areaId ProjectGetAreaIdArgType, projectId ProjectGetProjectIdArgType, state ProjectGetStateArgType) *Project { - this := Project{} - setProjectGetAreaIdAttributeType(&this.AreaId, areaId) - setProjectGetProjectIdAttributeType(&this.ProjectId, projectId) - setProjectGetStateAttributeType(&this.State, state) - return &this -} - -// NewProjectWithDefaults instantiates a new Project 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 NewProjectWithDefaults() *Project { - this := Project{} - return &this -} - -// GetAreaId returns the AreaId field value -func (o *Project) GetAreaId() (ret ProjectGetAreaIdRetType) { - 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 *Project) GetAreaIdOk() (ret ProjectGetAreaIdRetType, ok bool) { - return getProjectGetAreaIdAttributeTypeOk(o.AreaId) -} - -// SetAreaId sets field value -func (o *Project) SetAreaId(v ProjectGetAreaIdRetType) { - setProjectGetAreaIdAttributeType(&o.AreaId, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Project) GetCreatedAt() (res ProjectGetCreatedAtRetType) { - 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 *Project) GetCreatedAtOk() (ret ProjectGetCreatedAtRetType, ok bool) { - return getProjectGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Project) 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 *Project) SetCreatedAt(v ProjectGetCreatedAtRetType) { - setProjectGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. -func (o *Project) GetInternetAccess() (res ProjectgetInternetAccessRetType) { - res, _ = o.GetInternetAccessOk() - return -} - -// GetInternetAccessOk returns a tuple with the InternetAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Project) GetInternetAccessOk() (ret ProjectgetInternetAccessRetType, ok bool) { - return getProjectgetInternetAccessAttributeTypeOk(o.InternetAccess) -} - -// HasInternetAccess returns a boolean if a field has been set. -func (o *Project) HasInternetAccess() bool { - _, ok := o.GetInternetAccessOk() - return ok -} - -// SetInternetAccess gets a reference to the given bool and assigns it to the InternetAccess field. -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() - return ret -} - -// GetProjectIdOk returns a tuple with the ProjectId 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) -} - -// 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) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Project) GetUpdatedAt() (res ProjectGetUpdatedAtRetType) { - 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 *Project) GetUpdatedAtOk() (ret ProjectGetUpdatedAtRetType, ok bool) { - return getProjectGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Project) 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 *Project) SetUpdatedAt(v ProjectGetUpdatedAtRetType) { - setProjectGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o Project) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getProjectGetAreaIdAttributeTypeOk(o.AreaId); ok { - toSerialize["AreaId"] = val - } - if val, ok := getProjectGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = 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 := getProjectGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableProject struct { - value *Project - isSet bool -} - -func (v NullableProject) Get() *Project { - return v.value -} - -func (v *NullableProject) Set(val *Project) { - v.value = val - v.isSet = true -} - -func (v NullableProject) IsSet() bool { - return v.isSet -} - -func (v *NullableProject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProject(val *Project) *NullableProject { - return &NullableProject{value: val, isSet: true} -} - -func (v NullableProject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_project_list_response.go b/services/iaasalpha/model_project_list_response.go deleted file mode 100644 index 3cb28824e..000000000 --- a/services/iaasalpha/model_project_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ProjectListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProjectListResponse{} - -/* - types and functions for items -*/ - -// isArray -type ProjectListResponseGetItemsAttributeType = *[]string -type ProjectListResponseGetItemsArgType = []string -type ProjectListResponseGetItemsRetType = []string - -func getProjectListResponseGetItemsAttributeTypeOk(arg ProjectListResponseGetItemsAttributeType) (ret ProjectListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectListResponseGetItemsAttributeType(arg *ProjectListResponseGetItemsAttributeType, val ProjectListResponseGetItemsRetType) { - *arg = &val -} - -// ProjectListResponse Project list response. -type ProjectListResponse struct { - // A list of STACKIT projects. - // REQUIRED - Items ProjectListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _ProjectListResponse ProjectListResponse - -// NewProjectListResponse instantiates a new ProjectListResponse 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 NewProjectListResponse(items ProjectListResponseGetItemsArgType) *ProjectListResponse { - this := ProjectListResponse{} - setProjectListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewProjectListResponseWithDefaults instantiates a new ProjectListResponse 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 NewProjectListResponseWithDefaults() *ProjectListResponse { - this := ProjectListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *ProjectListResponse) GetItems() (ret ProjectListResponseGetItemsRetType) { - 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 *ProjectListResponse) GetItemsOk() (ret ProjectListResponseGetItemsRetType, ok bool) { - return getProjectListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *ProjectListResponse) SetItems(v ProjectListResponseGetItemsRetType) { - setProjectListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getProjectListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableProjectListResponse struct { - value *ProjectListResponse - isSet bool -} - -func (v NullableProjectListResponse) Get() *ProjectListResponse { - return v.value -} - -func (v *NullableProjectListResponse) Set(val *ProjectListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableProjectListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableProjectListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProjectListResponse(val *ProjectListResponse) *NullableProjectListResponse { - return &NullableProjectListResponse{value: val, isSet: true} -} - -func (v NullableProjectListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProjectListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_project_list_response_test.go b/services/iaasalpha/model_project_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_project_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_project_test.go b/services/iaasalpha/model_project_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_project_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_protocol.go b/services/iaasalpha/model_protocol.go deleted file mode 100644 index 1e2ecec6d..000000000 --- a/services/iaasalpha/model_protocol.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the Protocol type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Protocol{} - -/* - types and functions for name -*/ - -// isNotNullableString -type ProtocolGetNameAttributeType = *string - -func getProtocolGetNameAttributeTypeOk(arg ProtocolGetNameAttributeType) (ret ProtocolGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProtocolGetNameAttributeType(arg *ProtocolGetNameAttributeType, val ProtocolGetNameRetType) { - *arg = &val -} - -type ProtocolGetNameArgType = string -type ProtocolGetNameRetType = string - -/* - types and functions for number -*/ - -// isLong -type ProtocolGetNumberAttributeType = *int64 -type ProtocolGetNumberArgType = int64 -type ProtocolGetNumberRetType = int64 - -func getProtocolGetNumberAttributeTypeOk(arg ProtocolGetNumberAttributeType) (ret ProtocolGetNumberRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProtocolGetNumberAttributeType(arg *ProtocolGetNumberAttributeType, val ProtocolGetNumberRetType) { - *arg = &val -} - -// Protocol The schema for a protocol of a security group rule. -type Protocol struct { - // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. - Name ProtocolGetNameAttributeType `json:"name,omitempty"` - // The protocol number which the rule should match. - Number ProtocolGetNumberAttributeType `json:"number,omitempty"` -} - -// NewProtocol instantiates a new Protocol 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 NewProtocol() *Protocol { - this := Protocol{} - return &this -} - -// NewProtocolWithDefaults instantiates a new Protocol 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 NewProtocolWithDefaults() *Protocol { - this := Protocol{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Protocol) GetName() (res ProtocolGetNameRetType) { - 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 *Protocol) GetNameOk() (ret ProtocolGetNameRetType, ok bool) { - return getProtocolGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *Protocol) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Protocol) SetName(v ProtocolGetNameRetType) { - setProtocolGetNameAttributeType(&o.Name, v) -} - -// GetNumber returns the Number field value if set, zero value otherwise. -func (o *Protocol) GetNumber() (res ProtocolGetNumberRetType) { - res, _ = o.GetNumberOk() - return -} - -// GetNumberOk returns a tuple with the Number field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Protocol) GetNumberOk() (ret ProtocolGetNumberRetType, ok bool) { - return getProtocolGetNumberAttributeTypeOk(o.Number) -} - -// HasNumber returns a boolean if a field has been set. -func (o *Protocol) HasNumber() bool { - _, ok := o.GetNumberOk() - return ok -} - -// SetNumber gets a reference to the given int64 and assigns it to the Number field. -func (o *Protocol) SetNumber(v ProtocolGetNumberRetType) { - setProtocolGetNumberAttributeType(&o.Number, v) -} - -func (o Protocol) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getProtocolGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getProtocolGetNumberAttributeTypeOk(o.Number); ok { - toSerialize["Number"] = val - } - return toSerialize, nil -} - -type NullableProtocol struct { - value *Protocol - isSet bool -} - -func (v NullableProtocol) Get() *Protocol { - return v.value -} - -func (v *NullableProtocol) Set(val *Protocol) { - v.value = val - v.isSet = true -} - -func (v NullableProtocol) IsSet() bool { - return v.isSet -} - -func (v *NullableProtocol) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProtocol(val *Protocol) *NullableProtocol { - return &NullableProtocol{value: val, isSet: true} -} - -func (v NullableProtocol) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProtocol) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_protocol_test.go b/services/iaasalpha/model_protocol_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_protocol_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_public_ip.go b/services/iaasalpha/model_public_ip.go deleted file mode 100644 index 5a0463cf2..000000000 --- a/services/iaasalpha/model_public_ip.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the PublicIp type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PublicIp{} - -/* - types and functions for id -*/ - -// isNotNullableString -type PublicIpGetIdAttributeType = *string - -func getPublicIpGetIdAttributeTypeOk(arg PublicIpGetIdAttributeType) (ret PublicIpGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicIpGetIdAttributeType(arg *PublicIpGetIdAttributeType, val PublicIpGetIdRetType) { - *arg = &val -} - -type PublicIpGetIdArgType = string -type PublicIpGetIdRetType = string - -/* - types and functions for ip -*/ - -// isNotNullableString -type PublicIpGetIpAttributeType = *string - -func getPublicIpGetIpAttributeTypeOk(arg PublicIpGetIpAttributeType) (ret PublicIpGetIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicIpGetIpAttributeType(arg *PublicIpGetIpAttributeType, val PublicIpGetIpRetType) { - *arg = &val -} - -type PublicIpGetIpArgType = string -type PublicIpGetIpRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type PublicIpGetLabelsAttributeType = *map[string]interface{} -type PublicIpGetLabelsArgType = map[string]interface{} -type PublicIpGetLabelsRetType = map[string]interface{} - -func getPublicIpGetLabelsAttributeTypeOk(arg PublicIpGetLabelsAttributeType) (ret PublicIpGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicIpGetLabelsAttributeType(arg *PublicIpGetLabelsAttributeType, val PublicIpGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for networkInterface -*/ - -// isNullableString -type PublicIpGetNetworkInterfaceAttributeType = *NullableString - -func getPublicIpGetNetworkInterfaceAttributeTypeOk(arg PublicIpGetNetworkInterfaceAttributeType) (ret PublicIpGetNetworkInterfaceRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setPublicIpGetNetworkInterfaceAttributeType(arg *PublicIpGetNetworkInterfaceAttributeType, val PublicIpGetNetworkInterfaceRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type PublicIpGetNetworkInterfaceArgType = *string -type PublicIpGetNetworkInterfaceRetType = *string - -// PublicIp Object that represents a public IP. -type PublicIp struct { - // Universally Unique Identifier (UUID). - Id PublicIpGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ip PublicIpGetIpAttributeType `json:"ip,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels PublicIpGetLabelsAttributeType `json:"labels,omitempty"` - // Universally Unique Identifier (UUID). - NetworkInterface PublicIpGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` -} - -// NewPublicIp instantiates a new PublicIp 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 NewPublicIp() *PublicIp { - this := PublicIp{} - return &this -} - -// NewPublicIpWithDefaults instantiates a new PublicIp 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 NewPublicIpWithDefaults() *PublicIp { - this := PublicIp{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *PublicIp) GetId() (res PublicIpGetIdRetType) { - 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 *PublicIp) GetIdOk() (ret PublicIpGetIdRetType, ok bool) { - return getPublicIpGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *PublicIp) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *PublicIp) SetId(v PublicIpGetIdRetType) { - setPublicIpGetIdAttributeType(&o.Id, v) -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *PublicIp) GetIp() (res PublicIpGetIpRetType) { - res, _ = o.GetIpOk() - return -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PublicIp) GetIpOk() (ret PublicIpGetIpRetType, ok bool) { - return getPublicIpGetIpAttributeTypeOk(o.Ip) -} - -// HasIp returns a boolean if a field has been set. -func (o *PublicIp) HasIp() bool { - _, ok := o.GetIpOk() - return ok -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *PublicIp) SetIp(v PublicIpGetIpRetType) { - setPublicIpGetIpAttributeType(&o.Ip, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PublicIp) GetLabels() (res PublicIpGetLabelsRetType) { - 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 *PublicIp) GetLabelsOk() (ret PublicIpGetLabelsRetType, ok bool) { - return getPublicIpGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *PublicIp) 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 *PublicIp) SetLabels(v PublicIpGetLabelsRetType) { - setPublicIpGetLabelsAttributeType(&o.Labels, v) -} - -// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *PublicIp) GetNetworkInterface() (res PublicIpGetNetworkInterfaceRetType) { - res, _ = o.GetNetworkInterfaceOk() - return -} - -// GetNetworkInterfaceOk returns a tuple with the NetworkInterface 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 *PublicIp) GetNetworkInterfaceOk() (ret PublicIpGetNetworkInterfaceRetType, ok bool) { - return getPublicIpGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) -} - -// HasNetworkInterface returns a boolean if a field has been set. -func (o *PublicIp) HasNetworkInterface() bool { - _, ok := o.GetNetworkInterfaceOk() - return ok -} - -// SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *PublicIp) SetNetworkInterface(v PublicIpGetNetworkInterfaceRetType) { - setPublicIpGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) -} - -// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil -func (o *PublicIp) SetNetworkInterfaceNil() { - o.NetworkInterface = nil -} - -// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil -func (o *PublicIp) UnsetNetworkInterface() { - o.NetworkInterface = nil -} - -func (o PublicIp) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPublicIpGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getPublicIpGetIpAttributeTypeOk(o.Ip); ok { - toSerialize["Ip"] = val - } - if val, ok := getPublicIpGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getPublicIpGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { - toSerialize["NetworkInterface"] = val - } - return toSerialize, nil -} - -type NullablePublicIp struct { - value *PublicIp - isSet bool -} - -func (v NullablePublicIp) Get() *PublicIp { - return v.value -} - -func (v *NullablePublicIp) Set(val *PublicIp) { - v.value = val - v.isSet = true -} - -func (v NullablePublicIp) IsSet() bool { - return v.isSet -} - -func (v *NullablePublicIp) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePublicIp(val *PublicIp) *NullablePublicIp { - return &NullablePublicIp{value: val, isSet: true} -} - -func (v NullablePublicIp) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePublicIp) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_public_ip_list_response.go b/services/iaasalpha/model_public_ip_list_response.go deleted file mode 100644 index f317fe47c..000000000 --- a/services/iaasalpha/model_public_ip_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the PublicIpListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PublicIpListResponse{} - -/* - types and functions for items -*/ - -// isArray -type PublicIpListResponseGetItemsAttributeType = *[]PublicIp -type PublicIpListResponseGetItemsArgType = []PublicIp -type PublicIpListResponseGetItemsRetType = []PublicIp - -func getPublicIpListResponseGetItemsAttributeTypeOk(arg PublicIpListResponseGetItemsAttributeType) (ret PublicIpListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicIpListResponseGetItemsAttributeType(arg *PublicIpListResponseGetItemsAttributeType, val PublicIpListResponseGetItemsRetType) { - *arg = &val -} - -// PublicIpListResponse Public IP list response. -type PublicIpListResponse struct { - // A list of public IPs. - // REQUIRED - Items PublicIpListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _PublicIpListResponse PublicIpListResponse - -// NewPublicIpListResponse instantiates a new PublicIpListResponse 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 NewPublicIpListResponse(items PublicIpListResponseGetItemsArgType) *PublicIpListResponse { - this := PublicIpListResponse{} - setPublicIpListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewPublicIpListResponseWithDefaults instantiates a new PublicIpListResponse 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 NewPublicIpListResponseWithDefaults() *PublicIpListResponse { - this := PublicIpListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *PublicIpListResponse) GetItems() (ret PublicIpListResponseGetItemsRetType) { - 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 *PublicIpListResponse) GetItemsOk() (ret PublicIpListResponseGetItemsRetType, ok bool) { - return getPublicIpListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *PublicIpListResponse) SetItems(v PublicIpListResponseGetItemsRetType) { - setPublicIpListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPublicIpListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullablePublicIpListResponse struct { - value *PublicIpListResponse - isSet bool -} - -func (v NullablePublicIpListResponse) Get() *PublicIpListResponse { - return v.value -} - -func (v *NullablePublicIpListResponse) Set(val *PublicIpListResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePublicIpListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePublicIpListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePublicIpListResponse(val *PublicIpListResponse) *NullablePublicIpListResponse { - return &NullablePublicIpListResponse{value: val, isSet: true} -} - -func (v NullablePublicIpListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePublicIpListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_public_ip_list_response_test.go b/services/iaasalpha/model_public_ip_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_public_ip_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_public_ip_test.go b/services/iaasalpha/model_public_ip_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_public_ip_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_public_network.go b/services/iaasalpha/model_public_network.go deleted file mode 100644 index 1904888e0..000000000 --- a/services/iaasalpha/model_public_network.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PublicNetwork{} - -/* - types and functions for cidr -*/ - -// isNotNullableString -type PublicNetworkGetCidrAttributeType = *string - -func getPublicNetworkGetCidrAttributeTypeOk(arg PublicNetworkGetCidrAttributeType) (ret PublicNetworkGetCidrRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicNetworkGetCidrAttributeType(arg *PublicNetworkGetCidrAttributeType, val PublicNetworkGetCidrRetType) { - *arg = &val -} - -type PublicNetworkGetCidrArgType = string -type PublicNetworkGetCidrRetType = string - -// PublicNetwork Public network. -type PublicNetwork struct { - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - Cidr PublicNetworkGetCidrAttributeType `json:"cidr" required:"true"` -} - -type _PublicNetwork PublicNetwork - -// NewPublicNetwork instantiates a new PublicNetwork 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 NewPublicNetwork(cidr PublicNetworkGetCidrArgType) *PublicNetwork { - this := PublicNetwork{} - setPublicNetworkGetCidrAttributeType(&this.Cidr, cidr) - return &this -} - -// NewPublicNetworkWithDefaults instantiates a new PublicNetwork 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 NewPublicNetworkWithDefaults() *PublicNetwork { - this := PublicNetwork{} - return &this -} - -// GetCidr returns the Cidr field value -func (o *PublicNetwork) GetCidr() (ret PublicNetworkGetCidrRetType) { - ret, _ = o.GetCidrOk() - return ret -} - -// GetCidrOk returns a tuple with the Cidr field value -// and a boolean to check if the value has been set. -func (o *PublicNetwork) GetCidrOk() (ret PublicNetworkGetCidrRetType, ok bool) { - return getPublicNetworkGetCidrAttributeTypeOk(o.Cidr) -} - -// SetCidr sets field value -func (o *PublicNetwork) SetCidr(v PublicNetworkGetCidrRetType) { - setPublicNetworkGetCidrAttributeType(&o.Cidr, v) -} - -func (o PublicNetwork) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPublicNetworkGetCidrAttributeTypeOk(o.Cidr); ok { - toSerialize["Cidr"] = val - } - return toSerialize, nil -} - -type NullablePublicNetwork struct { - value *PublicNetwork - isSet bool -} - -func (v NullablePublicNetwork) Get() *PublicNetwork { - return v.value -} - -func (v *NullablePublicNetwork) Set(val *PublicNetwork) { - v.value = val - v.isSet = true -} - -func (v NullablePublicNetwork) IsSet() bool { - return v.isSet -} - -func (v *NullablePublicNetwork) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { - return &NullablePublicNetwork{value: val, isSet: true} -} - -func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_public_network_list_response.go b/services/iaasalpha/model_public_network_list_response.go deleted file mode 100644 index 07fc2cfdf..000000000 --- a/services/iaasalpha/model_public_network_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the PublicNetworkListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PublicNetworkListResponse{} - -/* - types and functions for items -*/ - -// isArray -type PublicNetworkListResponseGetItemsAttributeType = *[]PublicNetwork -type PublicNetworkListResponseGetItemsArgType = []PublicNetwork -type PublicNetworkListResponseGetItemsRetType = []PublicNetwork - -func getPublicNetworkListResponseGetItemsAttributeTypeOk(arg PublicNetworkListResponseGetItemsAttributeType) (ret PublicNetworkListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPublicNetworkListResponseGetItemsAttributeType(arg *PublicNetworkListResponseGetItemsAttributeType, val PublicNetworkListResponseGetItemsRetType) { - *arg = &val -} - -// PublicNetworkListResponse Public network list response. -type PublicNetworkListResponse struct { - // A list of public networks. - // REQUIRED - Items PublicNetworkListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _PublicNetworkListResponse PublicNetworkListResponse - -// NewPublicNetworkListResponse instantiates a new PublicNetworkListResponse 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 NewPublicNetworkListResponse(items PublicNetworkListResponseGetItemsArgType) *PublicNetworkListResponse { - this := PublicNetworkListResponse{} - setPublicNetworkListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewPublicNetworkListResponseWithDefaults instantiates a new PublicNetworkListResponse 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 NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { - this := PublicNetworkListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *PublicNetworkListResponse) GetItems() (ret PublicNetworkListResponseGetItemsRetType) { - 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 *PublicNetworkListResponse) GetItemsOk() (ret PublicNetworkListResponseGetItemsRetType, ok bool) { - return getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *PublicNetworkListResponse) SetItems(v PublicNetworkListResponseGetItemsRetType) { - setPublicNetworkListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullablePublicNetworkListResponse struct { - value *PublicNetworkListResponse - isSet bool -} - -func (v NullablePublicNetworkListResponse) Get() *PublicNetworkListResponse { - return v.value -} - -func (v *NullablePublicNetworkListResponse) Set(val *PublicNetworkListResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePublicNetworkListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePublicNetworkListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePublicNetworkListResponse(val *PublicNetworkListResponse) *NullablePublicNetworkListResponse { - return &NullablePublicNetworkListResponse{value: val, isSet: true} -} - -func (v NullablePublicNetworkListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePublicNetworkListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_public_network_list_response_test.go b/services/iaasalpha/model_public_network_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_public_network_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_public_network_test.go b/services/iaasalpha/model_public_network_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_public_network_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota.go b/services/iaasalpha/model_quota.go deleted file mode 100644 index ba5e4da33..000000000 --- a/services/iaasalpha/model_quota.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the Quota type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Quota{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaGetLimitAttributeType = *int64 -type QuotaGetLimitArgType = int64 -type QuotaGetLimitRetType = int64 - -func getQuotaGetLimitAttributeTypeOk(arg QuotaGetLimitAttributeType) (ret QuotaGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaGetLimitAttributeType(arg *QuotaGetLimitAttributeType, val QuotaGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaGetUsageAttributeType = *int64 -type QuotaGetUsageArgType = int64 -type QuotaGetUsageRetType = int64 - -func getQuotaGetUsageAttributeTypeOk(arg QuotaGetUsageAttributeType) (ret QuotaGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaGetUsageAttributeType(arg *QuotaGetUsageAttributeType, val QuotaGetUsageRetType) { - *arg = &val -} - -// Quota Object that represents a single resource quota. -type Quota struct { - // REQUIRED - Limit QuotaGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaGetUsageAttributeType `json:"usage" required:"true"` -} - -type _Quota Quota - -// NewQuota instantiates a new Quota 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 NewQuota(limit QuotaGetLimitArgType, usage QuotaGetUsageArgType) *Quota { - this := Quota{} - setQuotaGetLimitAttributeType(&this.Limit, limit) - setQuotaGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaWithDefaults instantiates a new Quota 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 NewQuotaWithDefaults() *Quota { - this := Quota{} - return &this -} - -// GetLimit returns the Limit field value -func (o *Quota) GetLimit() (ret QuotaGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *Quota) GetLimitOk() (ret QuotaGetLimitRetType, ok bool) { - return getQuotaGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *Quota) SetLimit(v QuotaGetLimitRetType) { - setQuotaGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *Quota) GetUsage() (ret QuotaGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *Quota) GetUsageOk() (ret QuotaGetUsageRetType, ok bool) { - return getQuotaGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *Quota) SetUsage(v QuotaGetUsageRetType) { - setQuotaGetUsageAttributeType(&o.Usage, v) -} - -func (o Quota) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuota struct { - value *Quota - isSet bool -} - -func (v NullableQuota) Get() *Quota { - return v.value -} - -func (v *NullableQuota) Set(val *Quota) { - v.value = val - v.isSet = true -} - -func (v NullableQuota) IsSet() bool { - return v.isSet -} - -func (v *NullableQuota) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuota(val *Quota) *NullableQuota { - return &NullableQuota{value: val, isSet: true} -} - -func (v NullableQuota) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuota) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list.go b/services/iaasalpha/model_quota_list.go deleted file mode 100644 index aeb963d18..000000000 --- a/services/iaasalpha/model_quota_list.go +++ /dev/null @@ -1,598 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaList{} - -/* - types and functions for backupGigabytes -*/ - -// isModel -type QuotaListGetBackupGigabytesAttributeType = *QuotaListBackupGigabytes -type QuotaListGetBackupGigabytesArgType = QuotaListBackupGigabytes -type QuotaListGetBackupGigabytesRetType = QuotaListBackupGigabytes - -func getQuotaListGetBackupGigabytesAttributeTypeOk(arg QuotaListGetBackupGigabytesAttributeType) (ret QuotaListGetBackupGigabytesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetBackupGigabytesAttributeType(arg *QuotaListGetBackupGigabytesAttributeType, val QuotaListGetBackupGigabytesRetType) { - *arg = &val -} - -/* - types and functions for backups -*/ - -// isModel -type QuotaListGetBackupsAttributeType = *QuotaListBackups -type QuotaListGetBackupsArgType = QuotaListBackups -type QuotaListGetBackupsRetType = QuotaListBackups - -func getQuotaListGetBackupsAttributeTypeOk(arg QuotaListGetBackupsAttributeType) (ret QuotaListGetBackupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetBackupsAttributeType(arg *QuotaListGetBackupsAttributeType, val QuotaListGetBackupsRetType) { - *arg = &val -} - -/* - types and functions for gigabytes -*/ - -// isModel -type QuotaListGetGigabytesAttributeType = *QuotaListGigabytes -type QuotaListGetGigabytesArgType = QuotaListGigabytes -type QuotaListGetGigabytesRetType = QuotaListGigabytes - -func getQuotaListGetGigabytesAttributeTypeOk(arg QuotaListGetGigabytesAttributeType) (ret QuotaListGetGigabytesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetGigabytesAttributeType(arg *QuotaListGetGigabytesAttributeType, val QuotaListGetGigabytesRetType) { - *arg = &val -} - -/* - types and functions for networks -*/ - -// isModel -type QuotaListGetNetworksAttributeType = *QuotaListNetworks -type QuotaListGetNetworksArgType = QuotaListNetworks -type QuotaListGetNetworksRetType = QuotaListNetworks - -func getQuotaListGetNetworksAttributeTypeOk(arg QuotaListGetNetworksAttributeType) (ret QuotaListGetNetworksRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetNetworksAttributeType(arg *QuotaListGetNetworksAttributeType, val QuotaListGetNetworksRetType) { - *arg = &val -} - -/* - types and functions for nics -*/ - -// isModel -type QuotaListGetNicsAttributeType = *QuotaListNics -type QuotaListGetNicsArgType = QuotaListNics -type QuotaListGetNicsRetType = QuotaListNics - -func getQuotaListGetNicsAttributeTypeOk(arg QuotaListGetNicsAttributeType) (ret QuotaListGetNicsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetNicsAttributeType(arg *QuotaListGetNicsAttributeType, val QuotaListGetNicsRetType) { - *arg = &val -} - -/* - types and functions for publicIps -*/ - -// isModel -type QuotaListGetPublicIpsAttributeType = *QuotaListPublicIps -type QuotaListGetPublicIpsArgType = QuotaListPublicIps -type QuotaListGetPublicIpsRetType = QuotaListPublicIps - -func getQuotaListGetPublicIpsAttributeTypeOk(arg QuotaListGetPublicIpsAttributeType) (ret QuotaListGetPublicIpsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetPublicIpsAttributeType(arg *QuotaListGetPublicIpsAttributeType, val QuotaListGetPublicIpsRetType) { - *arg = &val -} - -/* - types and functions for ram -*/ - -// isModel -type QuotaListGetRamAttributeType = *QuotaListRam -type QuotaListGetRamArgType = QuotaListRam -type QuotaListGetRamRetType = QuotaListRam - -func getQuotaListGetRamAttributeTypeOk(arg QuotaListGetRamAttributeType) (ret QuotaListGetRamRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetRamAttributeType(arg *QuotaListGetRamAttributeType, val QuotaListGetRamRetType) { - *arg = &val -} - -/* - types and functions for securityGroupRules -*/ - -// isModel -type QuotaListGetSecurityGroupRulesAttributeType = *QuotaListSecurityGroupRules -type QuotaListGetSecurityGroupRulesArgType = QuotaListSecurityGroupRules -type QuotaListGetSecurityGroupRulesRetType = QuotaListSecurityGroupRules - -func getQuotaListGetSecurityGroupRulesAttributeTypeOk(arg QuotaListGetSecurityGroupRulesAttributeType) (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetSecurityGroupRulesAttributeType(arg *QuotaListGetSecurityGroupRulesAttributeType, val QuotaListGetSecurityGroupRulesRetType) { - *arg = &val -} - -/* - types and functions for securityGroups -*/ - -// isModel -type QuotaListGetSecurityGroupsAttributeType = *QuotaListSecurityGroups -type QuotaListGetSecurityGroupsArgType = QuotaListSecurityGroups -type QuotaListGetSecurityGroupsRetType = QuotaListSecurityGroups - -func getQuotaListGetSecurityGroupsAttributeTypeOk(arg QuotaListGetSecurityGroupsAttributeType) (ret QuotaListGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetSecurityGroupsAttributeType(arg *QuotaListGetSecurityGroupsAttributeType, val QuotaListGetSecurityGroupsRetType) { - *arg = &val -} - -/* - types and functions for snapshots -*/ - -// isModel -type QuotaListGetSnapshotsAttributeType = *QuotaListSnapshots -type QuotaListGetSnapshotsArgType = QuotaListSnapshots -type QuotaListGetSnapshotsRetType = QuotaListSnapshots - -func getQuotaListGetSnapshotsAttributeTypeOk(arg QuotaListGetSnapshotsAttributeType) (ret QuotaListGetSnapshotsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetSnapshotsAttributeType(arg *QuotaListGetSnapshotsAttributeType, val QuotaListGetSnapshotsRetType) { - *arg = &val -} - -/* - types and functions for vcpu -*/ - -// isModel -type QuotaListGetVcpuAttributeType = *QuotaListVcpu -type QuotaListGetVcpuArgType = QuotaListVcpu -type QuotaListGetVcpuRetType = QuotaListVcpu - -func getQuotaListGetVcpuAttributeTypeOk(arg QuotaListGetVcpuAttributeType) (ret QuotaListGetVcpuRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetVcpuAttributeType(arg *QuotaListGetVcpuAttributeType, val QuotaListGetVcpuRetType) { - *arg = &val -} - -/* - types and functions for volumes -*/ - -// isModel -type QuotaListGetVolumesAttributeType = *QuotaListVolumes -type QuotaListGetVolumesArgType = QuotaListVolumes -type QuotaListGetVolumesRetType = QuotaListVolumes - -func getQuotaListGetVolumesAttributeTypeOk(arg QuotaListGetVolumesAttributeType) (ret QuotaListGetVolumesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGetVolumesAttributeType(arg *QuotaListGetVolumesAttributeType, val QuotaListGetVolumesRetType) { - *arg = &val -} - -// QuotaList Object that represents the quotas for a project. -type QuotaList struct { - // REQUIRED - BackupGigabytes QuotaListGetBackupGigabytesAttributeType `json:"backupGigabytes" required:"true"` - // REQUIRED - Backups QuotaListGetBackupsAttributeType `json:"backups" required:"true"` - // REQUIRED - Gigabytes QuotaListGetGigabytesAttributeType `json:"gigabytes" required:"true"` - // REQUIRED - Networks QuotaListGetNetworksAttributeType `json:"networks" required:"true"` - // REQUIRED - Nics QuotaListGetNicsAttributeType `json:"nics" required:"true"` - // REQUIRED - PublicIps QuotaListGetPublicIpsAttributeType `json:"publicIps" required:"true"` - // REQUIRED - Ram QuotaListGetRamAttributeType `json:"ram" required:"true"` - // REQUIRED - SecurityGroupRules QuotaListGetSecurityGroupRulesAttributeType `json:"securityGroupRules" required:"true"` - // REQUIRED - SecurityGroups QuotaListGetSecurityGroupsAttributeType `json:"securityGroups" required:"true"` - // REQUIRED - Snapshots QuotaListGetSnapshotsAttributeType `json:"snapshots" required:"true"` - // REQUIRED - Vcpu QuotaListGetVcpuAttributeType `json:"vcpu" required:"true"` - // REQUIRED - Volumes QuotaListGetVolumesAttributeType `json:"volumes" required:"true"` -} - -type _QuotaList QuotaList - -// NewQuotaList instantiates a new QuotaList 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 NewQuotaList(backupGigabytes QuotaListGetBackupGigabytesArgType, backups QuotaListGetBackupsArgType, gigabytes QuotaListGetGigabytesArgType, networks QuotaListGetNetworksArgType, nics QuotaListGetNicsArgType, publicIps QuotaListGetPublicIpsArgType, ram QuotaListGetRamArgType, securityGroupRules QuotaListGetSecurityGroupRulesArgType, securityGroups QuotaListGetSecurityGroupsArgType, snapshots QuotaListGetSnapshotsArgType, vcpu QuotaListGetVcpuArgType, volumes QuotaListGetVolumesArgType) *QuotaList { - this := QuotaList{} - setQuotaListGetBackupGigabytesAttributeType(&this.BackupGigabytes, backupGigabytes) - setQuotaListGetBackupsAttributeType(&this.Backups, backups) - setQuotaListGetGigabytesAttributeType(&this.Gigabytes, gigabytes) - setQuotaListGetNetworksAttributeType(&this.Networks, networks) - setQuotaListGetNicsAttributeType(&this.Nics, nics) - setQuotaListGetPublicIpsAttributeType(&this.PublicIps, publicIps) - setQuotaListGetRamAttributeType(&this.Ram, ram) - setQuotaListGetSecurityGroupRulesAttributeType(&this.SecurityGroupRules, securityGroupRules) - setQuotaListGetSecurityGroupsAttributeType(&this.SecurityGroups, securityGroups) - setQuotaListGetSnapshotsAttributeType(&this.Snapshots, snapshots) - setQuotaListGetVcpuAttributeType(&this.Vcpu, vcpu) - setQuotaListGetVolumesAttributeType(&this.Volumes, volumes) - return &this -} - -// NewQuotaListWithDefaults instantiates a new QuotaList 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 NewQuotaListWithDefaults() *QuotaList { - this := QuotaList{} - return &this -} - -// GetBackupGigabytes returns the BackupGigabytes field value -func (o *QuotaList) GetBackupGigabytes() (ret QuotaListGetBackupGigabytesRetType) { - ret, _ = o.GetBackupGigabytesOk() - return ret -} - -// GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetBackupGigabytesOk() (ret QuotaListGetBackupGigabytesRetType, ok bool) { - return getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes) -} - -// SetBackupGigabytes sets field value -func (o *QuotaList) SetBackupGigabytes(v QuotaListGetBackupGigabytesRetType) { - setQuotaListGetBackupGigabytesAttributeType(&o.BackupGigabytes, v) -} - -// GetBackups returns the Backups field value -func (o *QuotaList) GetBackups() (ret QuotaListGetBackupsRetType) { - ret, _ = o.GetBackupsOk() - return ret -} - -// GetBackupsOk returns a tuple with the Backups field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetBackupsOk() (ret QuotaListGetBackupsRetType, ok bool) { - return getQuotaListGetBackupsAttributeTypeOk(o.Backups) -} - -// SetBackups sets field value -func (o *QuotaList) SetBackups(v QuotaListGetBackupsRetType) { - setQuotaListGetBackupsAttributeType(&o.Backups, v) -} - -// GetGigabytes returns the Gigabytes field value -func (o *QuotaList) GetGigabytes() (ret QuotaListGetGigabytesRetType) { - ret, _ = o.GetGigabytesOk() - return ret -} - -// GetGigabytesOk returns a tuple with the Gigabytes field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetGigabytesOk() (ret QuotaListGetGigabytesRetType, ok bool) { - return getQuotaListGetGigabytesAttributeTypeOk(o.Gigabytes) -} - -// SetGigabytes sets field value -func (o *QuotaList) SetGigabytes(v QuotaListGetGigabytesRetType) { - setQuotaListGetGigabytesAttributeType(&o.Gigabytes, v) -} - -// GetNetworks returns the Networks field value -func (o *QuotaList) GetNetworks() (ret QuotaListGetNetworksRetType) { - ret, _ = o.GetNetworksOk() - return ret -} - -// GetNetworksOk returns a tuple with the Networks field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetNetworksOk() (ret QuotaListGetNetworksRetType, ok bool) { - return getQuotaListGetNetworksAttributeTypeOk(o.Networks) -} - -// SetNetworks sets field value -func (o *QuotaList) SetNetworks(v QuotaListGetNetworksRetType) { - setQuotaListGetNetworksAttributeType(&o.Networks, v) -} - -// GetNics returns the Nics field value -func (o *QuotaList) GetNics() (ret QuotaListGetNicsRetType) { - ret, _ = o.GetNicsOk() - return ret -} - -// GetNicsOk returns a tuple with the Nics field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetNicsOk() (ret QuotaListGetNicsRetType, ok bool) { - return getQuotaListGetNicsAttributeTypeOk(o.Nics) -} - -// SetNics sets field value -func (o *QuotaList) SetNics(v QuotaListGetNicsRetType) { - setQuotaListGetNicsAttributeType(&o.Nics, v) -} - -// GetPublicIps returns the PublicIps field value -func (o *QuotaList) GetPublicIps() (ret QuotaListGetPublicIpsRetType) { - ret, _ = o.GetPublicIpsOk() - return ret -} - -// GetPublicIpsOk returns a tuple with the PublicIps field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetPublicIpsOk() (ret QuotaListGetPublicIpsRetType, ok bool) { - return getQuotaListGetPublicIpsAttributeTypeOk(o.PublicIps) -} - -// SetPublicIps sets field value -func (o *QuotaList) SetPublicIps(v QuotaListGetPublicIpsRetType) { - setQuotaListGetPublicIpsAttributeType(&o.PublicIps, v) -} - -// GetRam returns the Ram field value -func (o *QuotaList) GetRam() (ret QuotaListGetRamRetType) { - ret, _ = o.GetRamOk() - return ret -} - -// GetRamOk returns a tuple with the Ram field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetRamOk() (ret QuotaListGetRamRetType, ok bool) { - return getQuotaListGetRamAttributeTypeOk(o.Ram) -} - -// SetRam sets field value -func (o *QuotaList) SetRam(v QuotaListGetRamRetType) { - setQuotaListGetRamAttributeType(&o.Ram, v) -} - -// GetSecurityGroupRules returns the SecurityGroupRules field value -func (o *QuotaList) GetSecurityGroupRules() (ret QuotaListGetSecurityGroupRulesRetType) { - ret, _ = o.GetSecurityGroupRulesOk() - return ret -} - -// GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetSecurityGroupRulesOk() (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { - return getQuotaListGetSecurityGroupRulesAttributeTypeOk(o.SecurityGroupRules) -} - -// SetSecurityGroupRules sets field value -func (o *QuotaList) SetSecurityGroupRules(v QuotaListGetSecurityGroupRulesRetType) { - setQuotaListGetSecurityGroupRulesAttributeType(&o.SecurityGroupRules, v) -} - -// GetSecurityGroups returns the SecurityGroups field value -func (o *QuotaList) GetSecurityGroups() (ret QuotaListGetSecurityGroupsRetType) { - ret, _ = o.GetSecurityGroupsOk() - return ret -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetSecurityGroupsOk() (ret QuotaListGetSecurityGroupsRetType, ok bool) { - return getQuotaListGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// SetSecurityGroups sets field value -func (o *QuotaList) SetSecurityGroups(v QuotaListGetSecurityGroupsRetType) { - setQuotaListGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -// GetSnapshots returns the Snapshots field value -func (o *QuotaList) GetSnapshots() (ret QuotaListGetSnapshotsRetType) { - ret, _ = o.GetSnapshotsOk() - return ret -} - -// GetSnapshotsOk returns a tuple with the Snapshots field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetSnapshotsOk() (ret QuotaListGetSnapshotsRetType, ok bool) { - return getQuotaListGetSnapshotsAttributeTypeOk(o.Snapshots) -} - -// SetSnapshots sets field value -func (o *QuotaList) SetSnapshots(v QuotaListGetSnapshotsRetType) { - setQuotaListGetSnapshotsAttributeType(&o.Snapshots, v) -} - -// GetVcpu returns the Vcpu field value -func (o *QuotaList) GetVcpu() (ret QuotaListGetVcpuRetType) { - ret, _ = o.GetVcpuOk() - return ret -} - -// GetVcpuOk returns a tuple with the Vcpu field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetVcpuOk() (ret QuotaListGetVcpuRetType, ok bool) { - return getQuotaListGetVcpuAttributeTypeOk(o.Vcpu) -} - -// SetVcpu sets field value -func (o *QuotaList) SetVcpu(v QuotaListGetVcpuRetType) { - setQuotaListGetVcpuAttributeType(&o.Vcpu, v) -} - -// GetVolumes returns the Volumes field value -func (o *QuotaList) GetVolumes() (ret QuotaListGetVolumesRetType) { - ret, _ = o.GetVolumesOk() - return ret -} - -// GetVolumesOk returns a tuple with the Volumes field value -// and a boolean to check if the value has been set. -func (o *QuotaList) GetVolumesOk() (ret QuotaListGetVolumesRetType, ok bool) { - return getQuotaListGetVolumesAttributeTypeOk(o.Volumes) -} - -// SetVolumes sets field value -func (o *QuotaList) SetVolumes(v QuotaListGetVolumesRetType) { - setQuotaListGetVolumesAttributeType(&o.Volumes, v) -} - -func (o QuotaList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes); ok { - toSerialize["BackupGigabytes"] = val - } - if val, ok := getQuotaListGetBackupsAttributeTypeOk(o.Backups); ok { - toSerialize["Backups"] = val - } - if val, ok := getQuotaListGetGigabytesAttributeTypeOk(o.Gigabytes); ok { - toSerialize["Gigabytes"] = val - } - if val, ok := getQuotaListGetNetworksAttributeTypeOk(o.Networks); ok { - toSerialize["Networks"] = val - } - if val, ok := getQuotaListGetNicsAttributeTypeOk(o.Nics); ok { - toSerialize["Nics"] = val - } - if val, ok := getQuotaListGetPublicIpsAttributeTypeOk(o.PublicIps); ok { - toSerialize["PublicIps"] = val - } - if val, ok := getQuotaListGetRamAttributeTypeOk(o.Ram); ok { - toSerialize["Ram"] = val - } - if val, ok := getQuotaListGetSecurityGroupRulesAttributeTypeOk(o.SecurityGroupRules); ok { - toSerialize["SecurityGroupRules"] = val - } - if val, ok := getQuotaListGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - if val, ok := getQuotaListGetSnapshotsAttributeTypeOk(o.Snapshots); ok { - toSerialize["Snapshots"] = val - } - if val, ok := getQuotaListGetVcpuAttributeTypeOk(o.Vcpu); ok { - toSerialize["Vcpu"] = val - } - if val, ok := getQuotaListGetVolumesAttributeTypeOk(o.Volumes); ok { - toSerialize["Volumes"] = val - } - return toSerialize, nil -} - -type NullableQuotaList struct { - value *QuotaList - isSet bool -} - -func (v NullableQuotaList) Get() *QuotaList { - return v.value -} - -func (v *NullableQuotaList) Set(val *QuotaList) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaList) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { - return &NullableQuotaList{value: val, isSet: true} -} - -func (v NullableQuotaList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_backup_gigabytes.go b/services/iaasalpha/model_quota_list_backup_gigabytes.go deleted file mode 100644 index 53cea972d..000000000 --- a/services/iaasalpha/model_quota_list_backup_gigabytes.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListBackupGigabytes type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListBackupGigabytes{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListBackupGigabytesGetLimitAttributeType = *int64 -type QuotaListBackupGigabytesGetLimitArgType = int64 -type QuotaListBackupGigabytesGetLimitRetType = int64 - -func getQuotaListBackupGigabytesGetLimitAttributeTypeOk(arg QuotaListBackupGigabytesGetLimitAttributeType) (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListBackupGigabytesGetLimitAttributeType(arg *QuotaListBackupGigabytesGetLimitAttributeType, val QuotaListBackupGigabytesGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListBackupGigabytesGetUsageAttributeType = *int64 -type QuotaListBackupGigabytesGetUsageArgType = int64 -type QuotaListBackupGigabytesGetUsageRetType = int64 - -func getQuotaListBackupGigabytesGetUsageAttributeTypeOk(arg QuotaListBackupGigabytesGetUsageAttributeType) (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListBackupGigabytesGetUsageAttributeType(arg *QuotaListBackupGigabytesGetUsageAttributeType, val QuotaListBackupGigabytesGetUsageRetType) { - *arg = &val -} - -// QuotaListBackupGigabytes Total size in GiB of backups. -type QuotaListBackupGigabytes struct { - // REQUIRED - Limit QuotaListBackupGigabytesGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListBackupGigabytesGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListBackupGigabytes QuotaListBackupGigabytes - -// NewQuotaListBackupGigabytes instantiates a new QuotaListBackupGigabytes 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 NewQuotaListBackupGigabytes(limit QuotaListBackupGigabytesGetLimitArgType, usage QuotaListBackupGigabytesGetUsageArgType) *QuotaListBackupGigabytes { - this := QuotaListBackupGigabytes{} - setQuotaListBackupGigabytesGetLimitAttributeType(&this.Limit, limit) - setQuotaListBackupGigabytesGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListBackupGigabytesWithDefaults instantiates a new QuotaListBackupGigabytes 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 NewQuotaListBackupGigabytesWithDefaults() *QuotaListBackupGigabytes { - this := QuotaListBackupGigabytes{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListBackupGigabytes) GetLimit() (ret QuotaListBackupGigabytesGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListBackupGigabytes) GetLimitOk() (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { - return getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListBackupGigabytes) SetLimit(v QuotaListBackupGigabytesGetLimitRetType) { - setQuotaListBackupGigabytesGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListBackupGigabytes) GetUsage() (ret QuotaListBackupGigabytesGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListBackupGigabytes) GetUsageOk() (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { - return getQuotaListBackupGigabytesGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListBackupGigabytes) SetUsage(v QuotaListBackupGigabytesGetUsageRetType) { - setQuotaListBackupGigabytesGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListBackupGigabytes) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListBackupGigabytesGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListBackupGigabytes struct { - value *QuotaListBackupGigabytes - isSet bool -} - -func (v NullableQuotaListBackupGigabytes) Get() *QuotaListBackupGigabytes { - return v.value -} - -func (v *NullableQuotaListBackupGigabytes) Set(val *QuotaListBackupGigabytes) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListBackupGigabytes) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListBackupGigabytes) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListBackupGigabytes(val *QuotaListBackupGigabytes) *NullableQuotaListBackupGigabytes { - return &NullableQuotaListBackupGigabytes{value: val, isSet: true} -} - -func (v NullableQuotaListBackupGigabytes) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListBackupGigabytes) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_backup_gigabytes_test.go b/services/iaasalpha/model_quota_list_backup_gigabytes_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_backup_gigabytes_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_backups.go b/services/iaasalpha/model_quota_list_backups.go deleted file mode 100644 index 8eecd4597..000000000 --- a/services/iaasalpha/model_quota_list_backups.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListBackups type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListBackups{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListBackupsGetLimitAttributeType = *int64 -type QuotaListBackupsGetLimitArgType = int64 -type QuotaListBackupsGetLimitRetType = int64 - -func getQuotaListBackupsGetLimitAttributeTypeOk(arg QuotaListBackupsGetLimitAttributeType) (ret QuotaListBackupsGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListBackupsGetLimitAttributeType(arg *QuotaListBackupsGetLimitAttributeType, val QuotaListBackupsGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListBackupsGetUsageAttributeType = *int64 -type QuotaListBackupsGetUsageArgType = int64 -type QuotaListBackupsGetUsageRetType = int64 - -func getQuotaListBackupsGetUsageAttributeTypeOk(arg QuotaListBackupsGetUsageAttributeType) (ret QuotaListBackupsGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListBackupsGetUsageAttributeType(arg *QuotaListBackupsGetUsageAttributeType, val QuotaListBackupsGetUsageRetType) { - *arg = &val -} - -// QuotaListBackups Number of backups. -type QuotaListBackups struct { - // REQUIRED - Limit QuotaListBackupsGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListBackupsGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListBackups QuotaListBackups - -// NewQuotaListBackups instantiates a new QuotaListBackups 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 NewQuotaListBackups(limit QuotaListBackupsGetLimitArgType, usage QuotaListBackupsGetUsageArgType) *QuotaListBackups { - this := QuotaListBackups{} - setQuotaListBackupsGetLimitAttributeType(&this.Limit, limit) - setQuotaListBackupsGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListBackupsWithDefaults instantiates a new QuotaListBackups 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 NewQuotaListBackupsWithDefaults() *QuotaListBackups { - this := QuotaListBackups{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListBackups) GetLimit() (ret QuotaListBackupsGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListBackups) GetLimitOk() (ret QuotaListBackupsGetLimitRetType, ok bool) { - return getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListBackups) SetLimit(v QuotaListBackupsGetLimitRetType) { - setQuotaListBackupsGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListBackups) GetUsage() (ret QuotaListBackupsGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListBackups) GetUsageOk() (ret QuotaListBackupsGetUsageRetType, ok bool) { - return getQuotaListBackupsGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListBackups) SetUsage(v QuotaListBackupsGetUsageRetType) { - setQuotaListBackupsGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListBackups) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListBackupsGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListBackups struct { - value *QuotaListBackups - isSet bool -} - -func (v NullableQuotaListBackups) Get() *QuotaListBackups { - return v.value -} - -func (v *NullableQuotaListBackups) Set(val *QuotaListBackups) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListBackups) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListBackups) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListBackups(val *QuotaListBackups) *NullableQuotaListBackups { - return &NullableQuotaListBackups{value: val, isSet: true} -} - -func (v NullableQuotaListBackups) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListBackups) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_backups_test.go b/services/iaasalpha/model_quota_list_backups_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_backups_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_gigabytes.go b/services/iaasalpha/model_quota_list_gigabytes.go deleted file mode 100644 index 2cda5cb1d..000000000 --- a/services/iaasalpha/model_quota_list_gigabytes.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListGigabytes type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListGigabytes{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListGigabytesGetLimitAttributeType = *int64 -type QuotaListGigabytesGetLimitArgType = int64 -type QuotaListGigabytesGetLimitRetType = int64 - -func getQuotaListGigabytesGetLimitAttributeTypeOk(arg QuotaListGigabytesGetLimitAttributeType) (ret QuotaListGigabytesGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGigabytesGetLimitAttributeType(arg *QuotaListGigabytesGetLimitAttributeType, val QuotaListGigabytesGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListGigabytesGetUsageAttributeType = *int64 -type QuotaListGigabytesGetUsageArgType = int64 -type QuotaListGigabytesGetUsageRetType = int64 - -func getQuotaListGigabytesGetUsageAttributeTypeOk(arg QuotaListGigabytesGetUsageAttributeType) (ret QuotaListGigabytesGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListGigabytesGetUsageAttributeType(arg *QuotaListGigabytesGetUsageAttributeType, val QuotaListGigabytesGetUsageRetType) { - *arg = &val -} - -// QuotaListGigabytes Total size in GiB of volumes and snapshots. -type QuotaListGigabytes struct { - // REQUIRED - Limit QuotaListGigabytesGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListGigabytesGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListGigabytes QuotaListGigabytes - -// NewQuotaListGigabytes instantiates a new QuotaListGigabytes 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 NewQuotaListGigabytes(limit QuotaListGigabytesGetLimitArgType, usage QuotaListGigabytesGetUsageArgType) *QuotaListGigabytes { - this := QuotaListGigabytes{} - setQuotaListGigabytesGetLimitAttributeType(&this.Limit, limit) - setQuotaListGigabytesGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListGigabytesWithDefaults instantiates a new QuotaListGigabytes 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 NewQuotaListGigabytesWithDefaults() *QuotaListGigabytes { - this := QuotaListGigabytes{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListGigabytes) GetLimit() (ret QuotaListGigabytesGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListGigabytes) GetLimitOk() (ret QuotaListGigabytesGetLimitRetType, ok bool) { - return getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListGigabytes) SetLimit(v QuotaListGigabytesGetLimitRetType) { - setQuotaListGigabytesGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListGigabytes) GetUsage() (ret QuotaListGigabytesGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListGigabytes) GetUsageOk() (ret QuotaListGigabytesGetUsageRetType, ok bool) { - return getQuotaListGigabytesGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListGigabytes) SetUsage(v QuotaListGigabytesGetUsageRetType) { - setQuotaListGigabytesGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListGigabytes) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListGigabytesGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListGigabytes struct { - value *QuotaListGigabytes - isSet bool -} - -func (v NullableQuotaListGigabytes) Get() *QuotaListGigabytes { - return v.value -} - -func (v *NullableQuotaListGigabytes) Set(val *QuotaListGigabytes) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListGigabytes) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListGigabytes) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListGigabytes(val *QuotaListGigabytes) *NullableQuotaListGigabytes { - return &NullableQuotaListGigabytes{value: val, isSet: true} -} - -func (v NullableQuotaListGigabytes) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListGigabytes) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_gigabytes_test.go b/services/iaasalpha/model_quota_list_gigabytes_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_gigabytes_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_networks.go b/services/iaasalpha/model_quota_list_networks.go deleted file mode 100644 index 5ee8a140c..000000000 --- a/services/iaasalpha/model_quota_list_networks.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListNetworks type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListNetworks{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListNetworksGetLimitAttributeType = *int64 -type QuotaListNetworksGetLimitArgType = int64 -type QuotaListNetworksGetLimitRetType = int64 - -func getQuotaListNetworksGetLimitAttributeTypeOk(arg QuotaListNetworksGetLimitAttributeType) (ret QuotaListNetworksGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListNetworksGetLimitAttributeType(arg *QuotaListNetworksGetLimitAttributeType, val QuotaListNetworksGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListNetworksGetUsageAttributeType = *int64 -type QuotaListNetworksGetUsageArgType = int64 -type QuotaListNetworksGetUsageRetType = int64 - -func getQuotaListNetworksGetUsageAttributeTypeOk(arg QuotaListNetworksGetUsageAttributeType) (ret QuotaListNetworksGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListNetworksGetUsageAttributeType(arg *QuotaListNetworksGetUsageAttributeType, val QuotaListNetworksGetUsageRetType) { - *arg = &val -} - -// QuotaListNetworks Number of networks. -type QuotaListNetworks struct { - // REQUIRED - Limit QuotaListNetworksGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListNetworksGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListNetworks QuotaListNetworks - -// NewQuotaListNetworks instantiates a new QuotaListNetworks 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 NewQuotaListNetworks(limit QuotaListNetworksGetLimitArgType, usage QuotaListNetworksGetUsageArgType) *QuotaListNetworks { - this := QuotaListNetworks{} - setQuotaListNetworksGetLimitAttributeType(&this.Limit, limit) - setQuotaListNetworksGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListNetworksWithDefaults instantiates a new QuotaListNetworks 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 NewQuotaListNetworksWithDefaults() *QuotaListNetworks { - this := QuotaListNetworks{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListNetworks) GetLimit() (ret QuotaListNetworksGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListNetworks) GetLimitOk() (ret QuotaListNetworksGetLimitRetType, ok bool) { - return getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListNetworks) SetLimit(v QuotaListNetworksGetLimitRetType) { - setQuotaListNetworksGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListNetworks) GetUsage() (ret QuotaListNetworksGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListNetworks) GetUsageOk() (ret QuotaListNetworksGetUsageRetType, ok bool) { - return getQuotaListNetworksGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListNetworks) SetUsage(v QuotaListNetworksGetUsageRetType) { - setQuotaListNetworksGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListNetworks) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListNetworksGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListNetworks struct { - value *QuotaListNetworks - isSet bool -} - -func (v NullableQuotaListNetworks) Get() *QuotaListNetworks { - return v.value -} - -func (v *NullableQuotaListNetworks) Set(val *QuotaListNetworks) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListNetworks) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListNetworks) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListNetworks(val *QuotaListNetworks) *NullableQuotaListNetworks { - return &NullableQuotaListNetworks{value: val, isSet: true} -} - -func (v NullableQuotaListNetworks) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListNetworks) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_networks_test.go b/services/iaasalpha/model_quota_list_networks_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_networks_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_nics.go b/services/iaasalpha/model_quota_list_nics.go deleted file mode 100644 index e4251af1c..000000000 --- a/services/iaasalpha/model_quota_list_nics.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListNics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListNics{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListNicsGetLimitAttributeType = *int64 -type QuotaListNicsGetLimitArgType = int64 -type QuotaListNicsGetLimitRetType = int64 - -func getQuotaListNicsGetLimitAttributeTypeOk(arg QuotaListNicsGetLimitAttributeType) (ret QuotaListNicsGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListNicsGetLimitAttributeType(arg *QuotaListNicsGetLimitAttributeType, val QuotaListNicsGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListNicsGetUsageAttributeType = *int64 -type QuotaListNicsGetUsageArgType = int64 -type QuotaListNicsGetUsageRetType = int64 - -func getQuotaListNicsGetUsageAttributeTypeOk(arg QuotaListNicsGetUsageAttributeType) (ret QuotaListNicsGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListNicsGetUsageAttributeType(arg *QuotaListNicsGetUsageAttributeType, val QuotaListNicsGetUsageRetType) { - *arg = &val -} - -// QuotaListNics Number of network interfaces. -type QuotaListNics struct { - // REQUIRED - Limit QuotaListNicsGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListNicsGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListNics QuotaListNics - -// NewQuotaListNics instantiates a new QuotaListNics 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 NewQuotaListNics(limit QuotaListNicsGetLimitArgType, usage QuotaListNicsGetUsageArgType) *QuotaListNics { - this := QuotaListNics{} - setQuotaListNicsGetLimitAttributeType(&this.Limit, limit) - setQuotaListNicsGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListNicsWithDefaults instantiates a new QuotaListNics 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 NewQuotaListNicsWithDefaults() *QuotaListNics { - this := QuotaListNics{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListNics) GetLimit() (ret QuotaListNicsGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListNics) GetLimitOk() (ret QuotaListNicsGetLimitRetType, ok bool) { - return getQuotaListNicsGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListNics) SetLimit(v QuotaListNicsGetLimitRetType) { - setQuotaListNicsGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListNics) GetUsage() (ret QuotaListNicsGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListNics) GetUsageOk() (ret QuotaListNicsGetUsageRetType, ok bool) { - return getQuotaListNicsGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListNics) SetUsage(v QuotaListNicsGetUsageRetType) { - setQuotaListNicsGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListNics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListNicsGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListNicsGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListNics struct { - value *QuotaListNics - isSet bool -} - -func (v NullableQuotaListNics) Get() *QuotaListNics { - return v.value -} - -func (v *NullableQuotaListNics) Set(val *QuotaListNics) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListNics) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListNics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListNics(val *QuotaListNics) *NullableQuotaListNics { - return &NullableQuotaListNics{value: val, isSet: true} -} - -func (v NullableQuotaListNics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListNics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_nics_test.go b/services/iaasalpha/model_quota_list_nics_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_nics_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_public_ips.go b/services/iaasalpha/model_quota_list_public_ips.go deleted file mode 100644 index 761dfb118..000000000 --- a/services/iaasalpha/model_quota_list_public_ips.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListPublicIps type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListPublicIps{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListPublicIpsGetLimitAttributeType = *int64 -type QuotaListPublicIpsGetLimitArgType = int64 -type QuotaListPublicIpsGetLimitRetType = int64 - -func getQuotaListPublicIpsGetLimitAttributeTypeOk(arg QuotaListPublicIpsGetLimitAttributeType) (ret QuotaListPublicIpsGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListPublicIpsGetLimitAttributeType(arg *QuotaListPublicIpsGetLimitAttributeType, val QuotaListPublicIpsGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListPublicIpsGetUsageAttributeType = *int64 -type QuotaListPublicIpsGetUsageArgType = int64 -type QuotaListPublicIpsGetUsageRetType = int64 - -func getQuotaListPublicIpsGetUsageAttributeTypeOk(arg QuotaListPublicIpsGetUsageAttributeType) (ret QuotaListPublicIpsGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListPublicIpsGetUsageAttributeType(arg *QuotaListPublicIpsGetUsageAttributeType, val QuotaListPublicIpsGetUsageRetType) { - *arg = &val -} - -// QuotaListPublicIps Number of public IP addresses. -type QuotaListPublicIps struct { - // REQUIRED - Limit QuotaListPublicIpsGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListPublicIpsGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListPublicIps QuotaListPublicIps - -// NewQuotaListPublicIps instantiates a new QuotaListPublicIps 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 NewQuotaListPublicIps(limit QuotaListPublicIpsGetLimitArgType, usage QuotaListPublicIpsGetUsageArgType) *QuotaListPublicIps { - this := QuotaListPublicIps{} - setQuotaListPublicIpsGetLimitAttributeType(&this.Limit, limit) - setQuotaListPublicIpsGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListPublicIpsWithDefaults instantiates a new QuotaListPublicIps 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 NewQuotaListPublicIpsWithDefaults() *QuotaListPublicIps { - this := QuotaListPublicIps{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListPublicIps) GetLimit() (ret QuotaListPublicIpsGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListPublicIps) GetLimitOk() (ret QuotaListPublicIpsGetLimitRetType, ok bool) { - return getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListPublicIps) SetLimit(v QuotaListPublicIpsGetLimitRetType) { - setQuotaListPublicIpsGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListPublicIps) GetUsage() (ret QuotaListPublicIpsGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListPublicIps) GetUsageOk() (ret QuotaListPublicIpsGetUsageRetType, ok bool) { - return getQuotaListPublicIpsGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListPublicIps) SetUsage(v QuotaListPublicIpsGetUsageRetType) { - setQuotaListPublicIpsGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListPublicIps) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListPublicIpsGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListPublicIps struct { - value *QuotaListPublicIps - isSet bool -} - -func (v NullableQuotaListPublicIps) Get() *QuotaListPublicIps { - return v.value -} - -func (v *NullableQuotaListPublicIps) Set(val *QuotaListPublicIps) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListPublicIps) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListPublicIps) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListPublicIps(val *QuotaListPublicIps) *NullableQuotaListPublicIps { - return &NullableQuotaListPublicIps{value: val, isSet: true} -} - -func (v NullableQuotaListPublicIps) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListPublicIps) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_public_ips_test.go b/services/iaasalpha/model_quota_list_public_ips_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_public_ips_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_ram.go b/services/iaasalpha/model_quota_list_ram.go deleted file mode 100644 index 34fbe055d..000000000 --- a/services/iaasalpha/model_quota_list_ram.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListRam type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListRam{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListRamGetLimitAttributeType = *int64 -type QuotaListRamGetLimitArgType = int64 -type QuotaListRamGetLimitRetType = int64 - -func getQuotaListRamGetLimitAttributeTypeOk(arg QuotaListRamGetLimitAttributeType) (ret QuotaListRamGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListRamGetLimitAttributeType(arg *QuotaListRamGetLimitAttributeType, val QuotaListRamGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListRamGetUsageAttributeType = *int64 -type QuotaListRamGetUsageArgType = int64 -type QuotaListRamGetUsageRetType = int64 - -func getQuotaListRamGetUsageAttributeTypeOk(arg QuotaListRamGetUsageAttributeType) (ret QuotaListRamGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListRamGetUsageAttributeType(arg *QuotaListRamGetUsageAttributeType, val QuotaListRamGetUsageRetType) { - *arg = &val -} - -// QuotaListRam Amount of server RAM in MiB. -type QuotaListRam struct { - // REQUIRED - Limit QuotaListRamGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListRamGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListRam QuotaListRam - -// NewQuotaListRam instantiates a new QuotaListRam 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 NewQuotaListRam(limit QuotaListRamGetLimitArgType, usage QuotaListRamGetUsageArgType) *QuotaListRam { - this := QuotaListRam{} - setQuotaListRamGetLimitAttributeType(&this.Limit, limit) - setQuotaListRamGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListRamWithDefaults instantiates a new QuotaListRam 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 NewQuotaListRamWithDefaults() *QuotaListRam { - this := QuotaListRam{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListRam) GetLimit() (ret QuotaListRamGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListRam) GetLimitOk() (ret QuotaListRamGetLimitRetType, ok bool) { - return getQuotaListRamGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListRam) SetLimit(v QuotaListRamGetLimitRetType) { - setQuotaListRamGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListRam) GetUsage() (ret QuotaListRamGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListRam) GetUsageOk() (ret QuotaListRamGetUsageRetType, ok bool) { - return getQuotaListRamGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListRam) SetUsage(v QuotaListRamGetUsageRetType) { - setQuotaListRamGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListRam) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListRamGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListRamGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListRam struct { - value *QuotaListRam - isSet bool -} - -func (v NullableQuotaListRam) Get() *QuotaListRam { - return v.value -} - -func (v *NullableQuotaListRam) Set(val *QuotaListRam) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListRam) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListRam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListRam(val *QuotaListRam) *NullableQuotaListRam { - return &NullableQuotaListRam{value: val, isSet: true} -} - -func (v NullableQuotaListRam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListRam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_ram_test.go b/services/iaasalpha/model_quota_list_ram_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_ram_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_response.go b/services/iaasalpha/model_quota_list_response.go deleted file mode 100644 index 98cc1bb58..000000000 --- a/services/iaasalpha/model_quota_list_response.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListResponse{} - -/* - types and functions for quotas -*/ - -// isModel -type QuotaListResponseGetQuotasAttributeType = *QuotaList -type QuotaListResponseGetQuotasArgType = QuotaList -type QuotaListResponseGetQuotasRetType = QuotaList - -func getQuotaListResponseGetQuotasAttributeTypeOk(arg QuotaListResponseGetQuotasAttributeType) (ret QuotaListResponseGetQuotasRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListResponseGetQuotasAttributeType(arg *QuotaListResponseGetQuotasAttributeType, val QuotaListResponseGetQuotasRetType) { - *arg = &val -} - -// QuotaListResponse Quotas list response. -type QuotaListResponse struct { - // REQUIRED - Quotas QuotaListResponseGetQuotasAttributeType `json:"quotas" required:"true"` -} - -type _QuotaListResponse QuotaListResponse - -// NewQuotaListResponse instantiates a new QuotaListResponse 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 NewQuotaListResponse(quotas QuotaListResponseGetQuotasArgType) *QuotaListResponse { - this := QuotaListResponse{} - setQuotaListResponseGetQuotasAttributeType(&this.Quotas, quotas) - return &this -} - -// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse 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 NewQuotaListResponseWithDefaults() *QuotaListResponse { - this := QuotaListResponse{} - return &this -} - -// GetQuotas returns the Quotas field value -func (o *QuotaListResponse) GetQuotas() (ret QuotaListResponseGetQuotasRetType) { - ret, _ = o.GetQuotasOk() - return ret -} - -// GetQuotasOk returns a tuple with the Quotas field value -// and a boolean to check if the value has been set. -func (o *QuotaListResponse) GetQuotasOk() (ret QuotaListResponseGetQuotasRetType, ok bool) { - return getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas) -} - -// SetQuotas sets field value -func (o *QuotaListResponse) SetQuotas(v QuotaListResponseGetQuotasRetType) { - setQuotaListResponseGetQuotasAttributeType(&o.Quotas, v) -} - -func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas); ok { - toSerialize["Quotas"] = val - } - return toSerialize, nil -} - -type NullableQuotaListResponse struct { - value *QuotaListResponse - isSet bool -} - -func (v NullableQuotaListResponse) Get() *QuotaListResponse { - return v.value -} - -func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { - return &NullableQuotaListResponse{value: val, isSet: true} -} - -func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_response_test.go b/services/iaasalpha/model_quota_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_security_group_rules.go b/services/iaasalpha/model_quota_list_security_group_rules.go deleted file mode 100644 index eca8982f0..000000000 --- a/services/iaasalpha/model_quota_list_security_group_rules.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListSecurityGroupRules type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListSecurityGroupRules{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListSecurityGroupRulesGetLimitAttributeType = *int64 -type QuotaListSecurityGroupRulesGetLimitArgType = int64 -type QuotaListSecurityGroupRulesGetLimitRetType = int64 - -func getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(arg QuotaListSecurityGroupRulesGetLimitAttributeType) (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSecurityGroupRulesGetLimitAttributeType(arg *QuotaListSecurityGroupRulesGetLimitAttributeType, val QuotaListSecurityGroupRulesGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListSecurityGroupRulesGetUsageAttributeType = *int64 -type QuotaListSecurityGroupRulesGetUsageArgType = int64 -type QuotaListSecurityGroupRulesGetUsageRetType = int64 - -func getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(arg QuotaListSecurityGroupRulesGetUsageAttributeType) (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSecurityGroupRulesGetUsageAttributeType(arg *QuotaListSecurityGroupRulesGetUsageAttributeType, val QuotaListSecurityGroupRulesGetUsageRetType) { - *arg = &val -} - -// QuotaListSecurityGroupRules Number of security group rules. -type QuotaListSecurityGroupRules struct { - // REQUIRED - Limit QuotaListSecurityGroupRulesGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListSecurityGroupRulesGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListSecurityGroupRules QuotaListSecurityGroupRules - -// NewQuotaListSecurityGroupRules instantiates a new QuotaListSecurityGroupRules 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 NewQuotaListSecurityGroupRules(limit QuotaListSecurityGroupRulesGetLimitArgType, usage QuotaListSecurityGroupRulesGetUsageArgType) *QuotaListSecurityGroupRules { - this := QuotaListSecurityGroupRules{} - setQuotaListSecurityGroupRulesGetLimitAttributeType(&this.Limit, limit) - setQuotaListSecurityGroupRulesGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListSecurityGroupRulesWithDefaults instantiates a new QuotaListSecurityGroupRules 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 NewQuotaListSecurityGroupRulesWithDefaults() *QuotaListSecurityGroupRules { - this := QuotaListSecurityGroupRules{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListSecurityGroupRules) GetLimit() (ret QuotaListSecurityGroupRulesGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroupRules) GetLimitOk() (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { - return getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListSecurityGroupRules) SetLimit(v QuotaListSecurityGroupRulesGetLimitRetType) { - setQuotaListSecurityGroupRulesGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListSecurityGroupRules) GetUsage() (ret QuotaListSecurityGroupRulesGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroupRules) GetUsageOk() (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { - return getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListSecurityGroupRules) SetUsage(v QuotaListSecurityGroupRulesGetUsageRetType) { - setQuotaListSecurityGroupRulesGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListSecurityGroupRules) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListSecurityGroupRules struct { - value *QuotaListSecurityGroupRules - isSet bool -} - -func (v NullableQuotaListSecurityGroupRules) Get() *QuotaListSecurityGroupRules { - return v.value -} - -func (v *NullableQuotaListSecurityGroupRules) Set(val *QuotaListSecurityGroupRules) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListSecurityGroupRules) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListSecurityGroupRules) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListSecurityGroupRules(val *QuotaListSecurityGroupRules) *NullableQuotaListSecurityGroupRules { - return &NullableQuotaListSecurityGroupRules{value: val, isSet: true} -} - -func (v NullableQuotaListSecurityGroupRules) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListSecurityGroupRules) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_security_group_rules_test.go b/services/iaasalpha/model_quota_list_security_group_rules_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_security_group_rules_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_security_groups.go b/services/iaasalpha/model_quota_list_security_groups.go deleted file mode 100644 index 8a48c2db0..000000000 --- a/services/iaasalpha/model_quota_list_security_groups.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListSecurityGroups type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListSecurityGroups{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListSecurityGroupsGetLimitAttributeType = *int64 -type QuotaListSecurityGroupsGetLimitArgType = int64 -type QuotaListSecurityGroupsGetLimitRetType = int64 - -func getQuotaListSecurityGroupsGetLimitAttributeTypeOk(arg QuotaListSecurityGroupsGetLimitAttributeType) (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSecurityGroupsGetLimitAttributeType(arg *QuotaListSecurityGroupsGetLimitAttributeType, val QuotaListSecurityGroupsGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListSecurityGroupsGetUsageAttributeType = *int64 -type QuotaListSecurityGroupsGetUsageArgType = int64 -type QuotaListSecurityGroupsGetUsageRetType = int64 - -func getQuotaListSecurityGroupsGetUsageAttributeTypeOk(arg QuotaListSecurityGroupsGetUsageAttributeType) (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSecurityGroupsGetUsageAttributeType(arg *QuotaListSecurityGroupsGetUsageAttributeType, val QuotaListSecurityGroupsGetUsageRetType) { - *arg = &val -} - -// QuotaListSecurityGroups Number of security groups. -type QuotaListSecurityGroups struct { - // REQUIRED - Limit QuotaListSecurityGroupsGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListSecurityGroupsGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListSecurityGroups QuotaListSecurityGroups - -// NewQuotaListSecurityGroups instantiates a new QuotaListSecurityGroups 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 NewQuotaListSecurityGroups(limit QuotaListSecurityGroupsGetLimitArgType, usage QuotaListSecurityGroupsGetUsageArgType) *QuotaListSecurityGroups { - this := QuotaListSecurityGroups{} - setQuotaListSecurityGroupsGetLimitAttributeType(&this.Limit, limit) - setQuotaListSecurityGroupsGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListSecurityGroupsWithDefaults instantiates a new QuotaListSecurityGroups 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 NewQuotaListSecurityGroupsWithDefaults() *QuotaListSecurityGroups { - this := QuotaListSecurityGroups{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListSecurityGroups) GetLimit() (ret QuotaListSecurityGroupsGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroups) GetLimitOk() (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { - return getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListSecurityGroups) SetLimit(v QuotaListSecurityGroupsGetLimitRetType) { - setQuotaListSecurityGroupsGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListSecurityGroups) GetUsage() (ret QuotaListSecurityGroupsGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroups) GetUsageOk() (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { - return getQuotaListSecurityGroupsGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListSecurityGroups) SetUsage(v QuotaListSecurityGroupsGetUsageRetType) { - setQuotaListSecurityGroupsGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListSecurityGroups) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListSecurityGroupsGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListSecurityGroups struct { - value *QuotaListSecurityGroups - isSet bool -} - -func (v NullableQuotaListSecurityGroups) Get() *QuotaListSecurityGroups { - return v.value -} - -func (v *NullableQuotaListSecurityGroups) Set(val *QuotaListSecurityGroups) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListSecurityGroups) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListSecurityGroups) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListSecurityGroups(val *QuotaListSecurityGroups) *NullableQuotaListSecurityGroups { - return &NullableQuotaListSecurityGroups{value: val, isSet: true} -} - -func (v NullableQuotaListSecurityGroups) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListSecurityGroups) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_security_groups_test.go b/services/iaasalpha/model_quota_list_security_groups_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_security_groups_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_snapshots.go b/services/iaasalpha/model_quota_list_snapshots.go deleted file mode 100644 index 8cdb84e09..000000000 --- a/services/iaasalpha/model_quota_list_snapshots.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListSnapshots type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListSnapshots{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListSnapshotsGetLimitAttributeType = *int64 -type QuotaListSnapshotsGetLimitArgType = int64 -type QuotaListSnapshotsGetLimitRetType = int64 - -func getQuotaListSnapshotsGetLimitAttributeTypeOk(arg QuotaListSnapshotsGetLimitAttributeType) (ret QuotaListSnapshotsGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSnapshotsGetLimitAttributeType(arg *QuotaListSnapshotsGetLimitAttributeType, val QuotaListSnapshotsGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListSnapshotsGetUsageAttributeType = *int64 -type QuotaListSnapshotsGetUsageArgType = int64 -type QuotaListSnapshotsGetUsageRetType = int64 - -func getQuotaListSnapshotsGetUsageAttributeTypeOk(arg QuotaListSnapshotsGetUsageAttributeType) (ret QuotaListSnapshotsGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListSnapshotsGetUsageAttributeType(arg *QuotaListSnapshotsGetUsageAttributeType, val QuotaListSnapshotsGetUsageRetType) { - *arg = &val -} - -// QuotaListSnapshots Number of snapshots. -type QuotaListSnapshots struct { - // REQUIRED - Limit QuotaListSnapshotsGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListSnapshotsGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListSnapshots QuotaListSnapshots - -// NewQuotaListSnapshots instantiates a new QuotaListSnapshots 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 NewQuotaListSnapshots(limit QuotaListSnapshotsGetLimitArgType, usage QuotaListSnapshotsGetUsageArgType) *QuotaListSnapshots { - this := QuotaListSnapshots{} - setQuotaListSnapshotsGetLimitAttributeType(&this.Limit, limit) - setQuotaListSnapshotsGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListSnapshotsWithDefaults instantiates a new QuotaListSnapshots 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 NewQuotaListSnapshotsWithDefaults() *QuotaListSnapshots { - this := QuotaListSnapshots{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListSnapshots) GetLimit() (ret QuotaListSnapshotsGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListSnapshots) GetLimitOk() (ret QuotaListSnapshotsGetLimitRetType, ok bool) { - return getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListSnapshots) SetLimit(v QuotaListSnapshotsGetLimitRetType) { - setQuotaListSnapshotsGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListSnapshots) GetUsage() (ret QuotaListSnapshotsGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListSnapshots) GetUsageOk() (ret QuotaListSnapshotsGetUsageRetType, ok bool) { - return getQuotaListSnapshotsGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListSnapshots) SetUsage(v QuotaListSnapshotsGetUsageRetType) { - setQuotaListSnapshotsGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListSnapshots) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListSnapshotsGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListSnapshots struct { - value *QuotaListSnapshots - isSet bool -} - -func (v NullableQuotaListSnapshots) Get() *QuotaListSnapshots { - return v.value -} - -func (v *NullableQuotaListSnapshots) Set(val *QuotaListSnapshots) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListSnapshots) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListSnapshots) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListSnapshots(val *QuotaListSnapshots) *NullableQuotaListSnapshots { - return &NullableQuotaListSnapshots{value: val, isSet: true} -} - -func (v NullableQuotaListSnapshots) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListSnapshots) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_snapshots_test.go b/services/iaasalpha/model_quota_list_snapshots_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_snapshots_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_test.go b/services/iaasalpha/model_quota_list_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_vcpu.go b/services/iaasalpha/model_quota_list_vcpu.go deleted file mode 100644 index 89cdbae59..000000000 --- a/services/iaasalpha/model_quota_list_vcpu.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListVcpu type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListVcpu{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListVcpuGetLimitAttributeType = *int64 -type QuotaListVcpuGetLimitArgType = int64 -type QuotaListVcpuGetLimitRetType = int64 - -func getQuotaListVcpuGetLimitAttributeTypeOk(arg QuotaListVcpuGetLimitAttributeType) (ret QuotaListVcpuGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListVcpuGetLimitAttributeType(arg *QuotaListVcpuGetLimitAttributeType, val QuotaListVcpuGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListVcpuGetUsageAttributeType = *int64 -type QuotaListVcpuGetUsageArgType = int64 -type QuotaListVcpuGetUsageRetType = int64 - -func getQuotaListVcpuGetUsageAttributeTypeOk(arg QuotaListVcpuGetUsageAttributeType) (ret QuotaListVcpuGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListVcpuGetUsageAttributeType(arg *QuotaListVcpuGetUsageAttributeType, val QuotaListVcpuGetUsageRetType) { - *arg = &val -} - -// QuotaListVcpu Number of server cores. -type QuotaListVcpu struct { - // REQUIRED - Limit QuotaListVcpuGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListVcpuGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListVcpu QuotaListVcpu - -// NewQuotaListVcpu instantiates a new QuotaListVcpu 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 NewQuotaListVcpu(limit QuotaListVcpuGetLimitArgType, usage QuotaListVcpuGetUsageArgType) *QuotaListVcpu { - this := QuotaListVcpu{} - setQuotaListVcpuGetLimitAttributeType(&this.Limit, limit) - setQuotaListVcpuGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListVcpuWithDefaults instantiates a new QuotaListVcpu 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 NewQuotaListVcpuWithDefaults() *QuotaListVcpu { - this := QuotaListVcpu{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListVcpu) GetLimit() (ret QuotaListVcpuGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListVcpu) GetLimitOk() (ret QuotaListVcpuGetLimitRetType, ok bool) { - return getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListVcpu) SetLimit(v QuotaListVcpuGetLimitRetType) { - setQuotaListVcpuGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListVcpu) GetUsage() (ret QuotaListVcpuGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListVcpu) GetUsageOk() (ret QuotaListVcpuGetUsageRetType, ok bool) { - return getQuotaListVcpuGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListVcpu) SetUsage(v QuotaListVcpuGetUsageRetType) { - setQuotaListVcpuGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListVcpu) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListVcpuGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListVcpu struct { - value *QuotaListVcpu - isSet bool -} - -func (v NullableQuotaListVcpu) Get() *QuotaListVcpu { - return v.value -} - -func (v *NullableQuotaListVcpu) Set(val *QuotaListVcpu) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListVcpu) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListVcpu) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListVcpu(val *QuotaListVcpu) *NullableQuotaListVcpu { - return &NullableQuotaListVcpu{value: val, isSet: true} -} - -func (v NullableQuotaListVcpu) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListVcpu) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_vcpu_test.go b/services/iaasalpha/model_quota_list_vcpu_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_vcpu_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_list_volumes.go b/services/iaasalpha/model_quota_list_volumes.go deleted file mode 100644 index 05635a624..000000000 --- a/services/iaasalpha/model_quota_list_volumes.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the QuotaListVolumes type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &QuotaListVolumes{} - -/* - types and functions for limit -*/ - -// isLong -type QuotaListVolumesGetLimitAttributeType = *int64 -type QuotaListVolumesGetLimitArgType = int64 -type QuotaListVolumesGetLimitRetType = int64 - -func getQuotaListVolumesGetLimitAttributeTypeOk(arg QuotaListVolumesGetLimitAttributeType) (ret QuotaListVolumesGetLimitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListVolumesGetLimitAttributeType(arg *QuotaListVolumesGetLimitAttributeType, val QuotaListVolumesGetLimitRetType) { - *arg = &val -} - -/* - types and functions for usage -*/ - -// isLong -type QuotaListVolumesGetUsageAttributeType = *int64 -type QuotaListVolumesGetUsageArgType = int64 -type QuotaListVolumesGetUsageRetType = int64 - -func getQuotaListVolumesGetUsageAttributeTypeOk(arg QuotaListVolumesGetUsageAttributeType) (ret QuotaListVolumesGetUsageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setQuotaListVolumesGetUsageAttributeType(arg *QuotaListVolumesGetUsageAttributeType, val QuotaListVolumesGetUsageRetType) { - *arg = &val -} - -// QuotaListVolumes Number of volumes. -type QuotaListVolumes struct { - // REQUIRED - Limit QuotaListVolumesGetLimitAttributeType `json:"limit" required:"true"` - // REQUIRED - Usage QuotaListVolumesGetUsageAttributeType `json:"usage" required:"true"` -} - -type _QuotaListVolumes QuotaListVolumes - -// NewQuotaListVolumes instantiates a new QuotaListVolumes 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 NewQuotaListVolumes(limit QuotaListVolumesGetLimitArgType, usage QuotaListVolumesGetUsageArgType) *QuotaListVolumes { - this := QuotaListVolumes{} - setQuotaListVolumesGetLimitAttributeType(&this.Limit, limit) - setQuotaListVolumesGetUsageAttributeType(&this.Usage, usage) - return &this -} - -// NewQuotaListVolumesWithDefaults instantiates a new QuotaListVolumes 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 NewQuotaListVolumesWithDefaults() *QuotaListVolumes { - this := QuotaListVolumes{} - return &this -} - -// GetLimit returns the Limit field value -func (o *QuotaListVolumes) GetLimit() (ret QuotaListVolumesGetLimitRetType) { - ret, _ = o.GetLimitOk() - return ret -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *QuotaListVolumes) GetLimitOk() (ret QuotaListVolumesGetLimitRetType, ok bool) { - return getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit) -} - -// SetLimit sets field value -func (o *QuotaListVolumes) SetLimit(v QuotaListVolumesGetLimitRetType) { - setQuotaListVolumesGetLimitAttributeType(&o.Limit, v) -} - -// GetUsage returns the Usage field value -func (o *QuotaListVolumes) GetUsage() (ret QuotaListVolumesGetUsageRetType) { - ret, _ = o.GetUsageOk() - return ret -} - -// GetUsageOk returns a tuple with the Usage field value -// and a boolean to check if the value has been set. -func (o *QuotaListVolumes) GetUsageOk() (ret QuotaListVolumesGetUsageRetType, ok bool) { - return getQuotaListVolumesGetUsageAttributeTypeOk(o.Usage) -} - -// SetUsage sets field value -func (o *QuotaListVolumes) SetUsage(v QuotaListVolumesGetUsageRetType) { - setQuotaListVolumesGetUsageAttributeType(&o.Usage, v) -} - -func (o QuotaListVolumes) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit); ok { - toSerialize["Limit"] = val - } - if val, ok := getQuotaListVolumesGetUsageAttributeTypeOk(o.Usage); ok { - toSerialize["Usage"] = val - } - return toSerialize, nil -} - -type NullableQuotaListVolumes struct { - value *QuotaListVolumes - isSet bool -} - -func (v NullableQuotaListVolumes) Get() *QuotaListVolumes { - return v.value -} - -func (v *NullableQuotaListVolumes) Set(val *QuotaListVolumes) { - v.value = val - v.isSet = true -} - -func (v NullableQuotaListVolumes) IsSet() bool { - return v.isSet -} - -func (v *NullableQuotaListVolumes) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableQuotaListVolumes(val *QuotaListVolumes) *NullableQuotaListVolumes { - return &NullableQuotaListVolumes{value: val, isSet: true} -} - -func (v NullableQuotaListVolumes) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableQuotaListVolumes) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_quota_list_volumes_test.go b/services/iaasalpha/model_quota_list_volumes_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_list_volumes_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_quota_test.go b/services/iaasalpha/model_quota_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_quota_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go b/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go deleted file mode 100644 index 47e36d4d9..000000000 --- a/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the RemoveMemberFromVirtualIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RemoveMemberFromVirtualIPPayload{} - -/* - types and functions for member -*/ - -// isNotNullableString -type RemoveMemberFromVirtualIPPayloadGetMemberAttributeType = *string - -func getRemoveMemberFromVirtualIPPayloadGetMemberAttributeTypeOk(arg RemoveMemberFromVirtualIPPayloadGetMemberAttributeType) (ret RemoveMemberFromVirtualIPPayloadGetMemberRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRemoveMemberFromVirtualIPPayloadGetMemberAttributeType(arg *RemoveMemberFromVirtualIPPayloadGetMemberAttributeType, val RemoveMemberFromVirtualIPPayloadGetMemberRetType) { - *arg = &val -} - -type RemoveMemberFromVirtualIPPayloadGetMemberArgType = string -type RemoveMemberFromVirtualIPPayloadGetMemberRetType = string - -// RemoveMemberFromVirtualIPPayload Object that represents a virtual IP member. -type RemoveMemberFromVirtualIPPayload struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Member RemoveMemberFromVirtualIPPayloadGetMemberAttributeType `json:"member" required:"true"` -} - -type _RemoveMemberFromVirtualIPPayload RemoveMemberFromVirtualIPPayload - -// NewRemoveMemberFromVirtualIPPayload instantiates a new RemoveMemberFromVirtualIPPayload 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 NewRemoveMemberFromVirtualIPPayload(member RemoveMemberFromVirtualIPPayloadGetMemberArgType) *RemoveMemberFromVirtualIPPayload { - this := RemoveMemberFromVirtualIPPayload{} - setRemoveMemberFromVirtualIPPayloadGetMemberAttributeType(&this.Member, member) - return &this -} - -// NewRemoveMemberFromVirtualIPPayloadWithDefaults instantiates a new RemoveMemberFromVirtualIPPayload 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 NewRemoveMemberFromVirtualIPPayloadWithDefaults() *RemoveMemberFromVirtualIPPayload { - this := RemoveMemberFromVirtualIPPayload{} - return &this -} - -// GetMember returns the Member field value -func (o *RemoveMemberFromVirtualIPPayload) GetMember() (ret RemoveMemberFromVirtualIPPayloadGetMemberRetType) { - ret, _ = o.GetMemberOk() - return ret -} - -// GetMemberOk returns a tuple with the Member field value -// and a boolean to check if the value has been set. -func (o *RemoveMemberFromVirtualIPPayload) GetMemberOk() (ret RemoveMemberFromVirtualIPPayloadGetMemberRetType, ok bool) { - return getRemoveMemberFromVirtualIPPayloadGetMemberAttributeTypeOk(o.Member) -} - -// SetMember sets field value -func (o *RemoveMemberFromVirtualIPPayload) SetMember(v RemoveMemberFromVirtualIPPayloadGetMemberRetType) { - setRemoveMemberFromVirtualIPPayloadGetMemberAttributeType(&o.Member, v) -} - -func (o RemoveMemberFromVirtualIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getRemoveMemberFromVirtualIPPayloadGetMemberAttributeTypeOk(o.Member); ok { - toSerialize["Member"] = val - } - return toSerialize, nil -} - -type NullableRemoveMemberFromVirtualIPPayload struct { - value *RemoveMemberFromVirtualIPPayload - isSet bool -} - -func (v NullableRemoveMemberFromVirtualIPPayload) Get() *RemoveMemberFromVirtualIPPayload { - return v.value -} - -func (v *NullableRemoveMemberFromVirtualIPPayload) Set(val *RemoveMemberFromVirtualIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableRemoveMemberFromVirtualIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableRemoveMemberFromVirtualIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRemoveMemberFromVirtualIPPayload(val *RemoveMemberFromVirtualIPPayload) *NullableRemoveMemberFromVirtualIPPayload { - return &NullableRemoveMemberFromVirtualIPPayload{value: val, isSet: true} -} - -func (v NullableRemoveMemberFromVirtualIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRemoveMemberFromVirtualIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_remove_member_from_virtual_ip_payload_test.go b/services/iaasalpha/model_remove_member_from_virtual_ip_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_remove_member_from_virtual_ip_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_request.go b/services/iaasalpha/model_request.go deleted file mode 100644 index 91268c3ef..000000000 --- a/services/iaasalpha/model_request.go +++ /dev/null @@ -1,353 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the Request type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Request{} - -/* - types and functions for details -*/ - -// isNotNullableString -type RequestGetDetailsAttributeType = *string - -func getRequestGetDetailsAttributeTypeOk(arg RequestGetDetailsAttributeType) (ret RequestGetDetailsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetDetailsAttributeType(arg *RequestGetDetailsAttributeType, val RequestGetDetailsRetType) { - *arg = &val -} - -type RequestGetDetailsArgType = string -type RequestGetDetailsRetType = string - -/* - types and functions for requestAction -*/ - -// isNotNullableString -type RequestGetRequestActionAttributeType = *string - -func getRequestGetRequestActionAttributeTypeOk(arg RequestGetRequestActionAttributeType) (ret RequestGetRequestActionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetRequestActionAttributeType(arg *RequestGetRequestActionAttributeType, val RequestGetRequestActionRetType) { - *arg = &val -} - -type RequestGetRequestActionArgType = string -type RequestGetRequestActionRetType = string - -/* - types and functions for requestId -*/ - -// isNotNullableString -type RequestGetRequestIdAttributeType = *string - -func getRequestGetRequestIdAttributeTypeOk(arg RequestGetRequestIdAttributeType) (ret RequestGetRequestIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetRequestIdAttributeType(arg *RequestGetRequestIdAttributeType, val RequestGetRequestIdRetType) { - *arg = &val -} - -type RequestGetRequestIdArgType = string -type RequestGetRequestIdRetType = string - -/* - types and functions for requestType -*/ - -// isNotNullableString -type RequestGetRequestTypeAttributeType = *string - -func getRequestGetRequestTypeAttributeTypeOk(arg RequestGetRequestTypeAttributeType) (ret RequestGetRequestTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetRequestTypeAttributeType(arg *RequestGetRequestTypeAttributeType, val RequestGetRequestTypeRetType) { - *arg = &val -} - -type RequestGetRequestTypeArgType = string -type RequestGetRequestTypeRetType = string - -/* - types and functions for resources -*/ - -// isArray -type RequestGetResourcesAttributeType = *[]RequestResource -type RequestGetResourcesArgType = []RequestResource -type RequestGetResourcesRetType = []RequestResource - -func getRequestGetResourcesAttributeTypeOk(arg RequestGetResourcesAttributeType) (ret RequestGetResourcesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetResourcesAttributeType(arg *RequestGetResourcesAttributeType, val RequestGetResourcesRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type RequestGetStatusAttributeType = *string - -func getRequestGetStatusAttributeTypeOk(arg RequestGetStatusAttributeType) (ret RequestGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestGetStatusAttributeType(arg *RequestGetStatusAttributeType, val RequestGetStatusRetType) { - *arg = &val -} - -type RequestGetStatusArgType = string -type RequestGetStatusRetType = string - -// Request Object that represents a request. -type Request struct { - Details RequestGetDetailsAttributeType `json:"details,omitempty"` - // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. - // REQUIRED - RequestAction RequestGetRequestActionAttributeType `json:"requestAction" required:"true"` - // Identifier (ID) representing a single API request. - // REQUIRED - RequestId RequestGetRequestIdAttributeType `json:"requestId" required:"true"` - // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. - // REQUIRED - RequestType RequestGetRequestTypeAttributeType `json:"requestType" required:"true"` - // REQUIRED - Resources RequestGetResourcesAttributeType `json:"resources" required:"true"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - // REQUIRED - Status RequestGetStatusAttributeType `json:"status" required:"true"` -} - -type _Request Request - -// NewRequest instantiates a new Request 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 NewRequest(requestAction RequestGetRequestActionArgType, requestId RequestGetRequestIdArgType, requestType RequestGetRequestTypeArgType, resources RequestGetResourcesArgType, status RequestGetStatusArgType) *Request { - this := Request{} - setRequestGetRequestActionAttributeType(&this.RequestAction, requestAction) - setRequestGetRequestIdAttributeType(&this.RequestId, requestId) - setRequestGetRequestTypeAttributeType(&this.RequestType, requestType) - setRequestGetResourcesAttributeType(&this.Resources, resources) - setRequestGetStatusAttributeType(&this.Status, status) - return &this -} - -// NewRequestWithDefaults instantiates a new Request 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 NewRequestWithDefaults() *Request { - this := Request{} - return &this -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *Request) GetDetails() (res RequestGetDetailsRetType) { - res, _ = o.GetDetailsOk() - return -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetDetailsOk() (ret RequestGetDetailsRetType, ok bool) { - return getRequestGetDetailsAttributeTypeOk(o.Details) -} - -// HasDetails returns a boolean if a field has been set. -func (o *Request) HasDetails() bool { - _, ok := o.GetDetailsOk() - return ok -} - -// SetDetails gets a reference to the given string and assigns it to the Details field. -func (o *Request) SetDetails(v RequestGetDetailsRetType) { - setRequestGetDetailsAttributeType(&o.Details, v) -} - -// GetRequestAction returns the RequestAction field value -func (o *Request) GetRequestAction() (ret RequestGetRequestActionRetType) { - ret, _ = o.GetRequestActionOk() - return ret -} - -// GetRequestActionOk returns a tuple with the RequestAction field value -// and a boolean to check if the value has been set. -func (o *Request) GetRequestActionOk() (ret RequestGetRequestActionRetType, ok bool) { - return getRequestGetRequestActionAttributeTypeOk(o.RequestAction) -} - -// SetRequestAction sets field value -func (o *Request) SetRequestAction(v RequestGetRequestActionRetType) { - setRequestGetRequestActionAttributeType(&o.RequestAction, v) -} - -// GetRequestId returns the RequestId field value -func (o *Request) GetRequestId() (ret RequestGetRequestIdRetType) { - ret, _ = o.GetRequestIdOk() - return ret -} - -// GetRequestIdOk returns a tuple with the RequestId field value -// and a boolean to check if the value has been set. -func (o *Request) GetRequestIdOk() (ret RequestGetRequestIdRetType, ok bool) { - return getRequestGetRequestIdAttributeTypeOk(o.RequestId) -} - -// SetRequestId sets field value -func (o *Request) SetRequestId(v RequestGetRequestIdRetType) { - setRequestGetRequestIdAttributeType(&o.RequestId, v) -} - -// GetRequestType returns the RequestType field value -func (o *Request) GetRequestType() (ret RequestGetRequestTypeRetType) { - ret, _ = o.GetRequestTypeOk() - return ret -} - -// GetRequestTypeOk returns a tuple with the RequestType field value -// and a boolean to check if the value has been set. -func (o *Request) GetRequestTypeOk() (ret RequestGetRequestTypeRetType, ok bool) { - return getRequestGetRequestTypeAttributeTypeOk(o.RequestType) -} - -// SetRequestType sets field value -func (o *Request) SetRequestType(v RequestGetRequestTypeRetType) { - setRequestGetRequestTypeAttributeType(&o.RequestType, v) -} - -// GetResources returns the Resources field value -func (o *Request) GetResources() (ret RequestGetResourcesRetType) { - ret, _ = o.GetResourcesOk() - return ret -} - -// GetResourcesOk returns a tuple with the Resources field value -// and a boolean to check if the value has been set. -func (o *Request) GetResourcesOk() (ret RequestGetResourcesRetType, ok bool) { - return getRequestGetResourcesAttributeTypeOk(o.Resources) -} - -// SetResources sets field value -func (o *Request) SetResources(v RequestGetResourcesRetType) { - setRequestGetResourcesAttributeType(&o.Resources, v) -} - -// GetStatus returns the Status field value -func (o *Request) GetStatus() (ret RequestGetStatusRetType) { - ret, _ = o.GetStatusOk() - return ret -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Request) GetStatusOk() (ret RequestGetStatusRetType, ok bool) { - return getRequestGetStatusAttributeTypeOk(o.Status) -} - -// SetStatus sets field value -func (o *Request) SetStatus(v RequestGetStatusRetType) { - setRequestGetStatusAttributeType(&o.Status, v) -} - -func (o Request) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getRequestGetDetailsAttributeTypeOk(o.Details); ok { - toSerialize["Details"] = val - } - if val, ok := getRequestGetRequestActionAttributeTypeOk(o.RequestAction); ok { - toSerialize["RequestAction"] = val - } - if val, ok := getRequestGetRequestIdAttributeTypeOk(o.RequestId); ok { - toSerialize["RequestId"] = val - } - if val, ok := getRequestGetRequestTypeAttributeTypeOk(o.RequestType); ok { - toSerialize["RequestType"] = val - } - if val, ok := getRequestGetResourcesAttributeTypeOk(o.Resources); ok { - toSerialize["Resources"] = val - } - if val, ok := getRequestGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - return toSerialize, nil -} - -type NullableRequest struct { - value *Request - isSet bool -} - -func (v NullableRequest) Get() *Request { - return v.value -} - -func (v *NullableRequest) Set(val *Request) { - v.value = val - v.isSet = true -} - -func (v NullableRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequest(val *Request) *NullableRequest { - return &NullableRequest{value: val, isSet: true} -} - -func (v NullableRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_request_resource.go b/services/iaasalpha/model_request_resource.go deleted file mode 100644 index 4d92e4c6d..000000000 --- a/services/iaasalpha/model_request_resource.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the RequestResource type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestResource{} - -/* - types and functions for id -*/ - -// isNotNullableString -type RequestResourceGetIdAttributeType = *string - -func getRequestResourceGetIdAttributeTypeOk(arg RequestResourceGetIdAttributeType) (ret RequestResourceGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestResourceGetIdAttributeType(arg *RequestResourceGetIdAttributeType, val RequestResourceGetIdRetType) { - *arg = &val -} - -type RequestResourceGetIdArgType = string -type RequestResourceGetIdRetType = string - -/* - types and functions for status -*/ - -// isNotNullableString -type RequestResourceGetStatusAttributeType = *string - -func getRequestResourceGetStatusAttributeTypeOk(arg RequestResourceGetStatusAttributeType) (ret RequestResourceGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestResourceGetStatusAttributeType(arg *RequestResourceGetStatusAttributeType, val RequestResourceGetStatusRetType) { - *arg = &val -} - -type RequestResourceGetStatusArgType = string -type RequestResourceGetStatusRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type RequestResourceGetTypeAttributeType = *string - -func getRequestResourceGetTypeAttributeTypeOk(arg RequestResourceGetTypeAttributeType) (ret RequestResourceGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRequestResourceGetTypeAttributeType(arg *RequestResourceGetTypeAttributeType, val RequestResourceGetTypeRetType) { - *arg = &val -} - -type RequestResourceGetTypeArgType = string -type RequestResourceGetTypeRetType = string - -// RequestResource Object that represents a resource as part of a request. -type RequestResource struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Id RequestResourceGetIdAttributeType `json:"id" required:"true"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - // REQUIRED - Status RequestResourceGetStatusAttributeType `json:"status" required:"true"` - // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. - // REQUIRED - Type RequestResourceGetTypeAttributeType `json:"type" required:"true"` -} - -type _RequestResource RequestResource - -// NewRequestResource instantiates a new RequestResource 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 NewRequestResource(id RequestResourceGetIdArgType, status RequestResourceGetStatusArgType, types RequestResourceGetTypeArgType) *RequestResource { - this := RequestResource{} - setRequestResourceGetIdAttributeType(&this.Id, id) - setRequestResourceGetStatusAttributeType(&this.Status, status) - setRequestResourceGetTypeAttributeType(&this.Type, types) - return &this -} - -// NewRequestResourceWithDefaults instantiates a new RequestResource 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 NewRequestResourceWithDefaults() *RequestResource { - this := RequestResource{} - return &this -} - -// GetId returns the Id field value -func (o *RequestResource) GetId() (ret RequestResourceGetIdRetType) { - 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 *RequestResource) GetIdOk() (ret RequestResourceGetIdRetType, ok bool) { - return getRequestResourceGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *RequestResource) SetId(v RequestResourceGetIdRetType) { - setRequestResourceGetIdAttributeType(&o.Id, v) -} - -// GetStatus returns the Status field value -func (o *RequestResource) GetStatus() (ret RequestResourceGetStatusRetType) { - ret, _ = o.GetStatusOk() - return ret -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *RequestResource) GetStatusOk() (ret RequestResourceGetStatusRetType, ok bool) { - return getRequestResourceGetStatusAttributeTypeOk(o.Status) -} - -// SetStatus sets field value -func (o *RequestResource) SetStatus(v RequestResourceGetStatusRetType) { - setRequestResourceGetStatusAttributeType(&o.Status, v) -} - -// GetType returns the Type field value -func (o *RequestResource) GetType() (ret RequestResourceGetTypeRetType) { - 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 *RequestResource) GetTypeOk() (ret RequestResourceGetTypeRetType, ok bool) { - return getRequestResourceGetTypeAttributeTypeOk(o.Type) -} - -// SetType sets field value -func (o *RequestResource) SetType(v RequestResourceGetTypeRetType) { - setRequestResourceGetTypeAttributeType(&o.Type, v) -} - -func (o RequestResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getRequestResourceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getRequestResourceGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getRequestResourceGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableRequestResource struct { - value *RequestResource - isSet bool -} - -func (v NullableRequestResource) Get() *RequestResource { - return v.value -} - -func (v *NullableRequestResource) Set(val *RequestResource) { - v.value = val - v.isSet = true -} - -func (v NullableRequestResource) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestResource(val *RequestResource) *NullableRequestResource { - return &NullableRequestResource{value: val, isSet: true} -} - -func (v NullableRequestResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_request_resource_test.go b/services/iaasalpha/model_request_resource_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_request_resource_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_request_test.go b/services/iaasalpha/model_request_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_request_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_rescue_server_payload.go b/services/iaasalpha/model_rescue_server_payload.go deleted file mode 100644 index 47531c599..000000000 --- a/services/iaasalpha/model_rescue_server_payload.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the RescueServerPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RescueServerPayload{} - -/* - types and functions for image -*/ - -// isNotNullableString -type RescueServerPayloadGetImageAttributeType = *string - -func getRescueServerPayloadGetImageAttributeTypeOk(arg RescueServerPayloadGetImageAttributeType) (ret RescueServerPayloadGetImageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRescueServerPayloadGetImageAttributeType(arg *RescueServerPayloadGetImageAttributeType, val RescueServerPayloadGetImageRetType) { - *arg = &val -} - -type RescueServerPayloadGetImageArgType = string -type RescueServerPayloadGetImageRetType = string - -// RescueServerPayload struct for RescueServerPayload -type RescueServerPayload struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Image RescueServerPayloadGetImageAttributeType `json:"image" required:"true"` -} - -type _RescueServerPayload RescueServerPayload - -// NewRescueServerPayload instantiates a new RescueServerPayload 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 NewRescueServerPayload(image RescueServerPayloadGetImageArgType) *RescueServerPayload { - this := RescueServerPayload{} - setRescueServerPayloadGetImageAttributeType(&this.Image, image) - return &this -} - -// NewRescueServerPayloadWithDefaults instantiates a new RescueServerPayload 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 NewRescueServerPayloadWithDefaults() *RescueServerPayload { - this := RescueServerPayload{} - return &this -} - -// GetImage returns the Image field value -func (o *RescueServerPayload) GetImage() (ret RescueServerPayloadGetImageRetType) { - ret, _ = o.GetImageOk() - return ret -} - -// GetImageOk returns a tuple with the Image field value -// and a boolean to check if the value has been set. -func (o *RescueServerPayload) GetImageOk() (ret RescueServerPayloadGetImageRetType, ok bool) { - return getRescueServerPayloadGetImageAttributeTypeOk(o.Image) -} - -// SetImage sets field value -func (o *RescueServerPayload) SetImage(v RescueServerPayloadGetImageRetType) { - setRescueServerPayloadGetImageAttributeType(&o.Image, v) -} - -func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getRescueServerPayloadGetImageAttributeTypeOk(o.Image); ok { - toSerialize["Image"] = val - } - return toSerialize, nil -} - -type NullableRescueServerPayload struct { - value *RescueServerPayload - isSet bool -} - -func (v NullableRescueServerPayload) Get() *RescueServerPayload { - return v.value -} - -func (v *NullableRescueServerPayload) Set(val *RescueServerPayload) { - v.value = val - v.isSet = true -} - -func (v NullableRescueServerPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableRescueServerPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRescueServerPayload(val *RescueServerPayload) *NullableRescueServerPayload { - return &NullableRescueServerPayload{value: val, isSet: true} -} - -func (v NullableRescueServerPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRescueServerPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_rescue_server_payload_test.go b/services/iaasalpha/model_rescue_server_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_rescue_server_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_resize_server_payload.go b/services/iaasalpha/model_resize_server_payload.go deleted file mode 100644 index e5fd12150..000000000 --- a/services/iaasalpha/model_resize_server_payload.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ResizeServerPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ResizeServerPayload{} - -/* - types and functions for machineType -*/ - -// isNotNullableString -type ResizeServerPayloadGetMachineTypeAttributeType = *string - -func getResizeServerPayloadGetMachineTypeAttributeTypeOk(arg ResizeServerPayloadGetMachineTypeAttributeType) (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setResizeServerPayloadGetMachineTypeAttributeType(arg *ResizeServerPayloadGetMachineTypeAttributeType, val ResizeServerPayloadGetMachineTypeRetType) { - *arg = &val -} - -type ResizeServerPayloadGetMachineTypeArgType = string -type ResizeServerPayloadGetMachineTypeRetType = string - -// ResizeServerPayload struct for ResizeServerPayload -type ResizeServerPayload struct { - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - MachineType ResizeServerPayloadGetMachineTypeAttributeType `json:"machineType" required:"true"` -} - -type _ResizeServerPayload ResizeServerPayload - -// NewResizeServerPayload instantiates a new ResizeServerPayload 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 NewResizeServerPayload(machineType ResizeServerPayloadGetMachineTypeArgType) *ResizeServerPayload { - this := ResizeServerPayload{} - setResizeServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) - return &this -} - -// NewResizeServerPayloadWithDefaults instantiates a new ResizeServerPayload 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 NewResizeServerPayloadWithDefaults() *ResizeServerPayload { - this := ResizeServerPayload{} - return &this -} - -// GetMachineType returns the MachineType field value -func (o *ResizeServerPayload) GetMachineType() (ret ResizeServerPayloadGetMachineTypeRetType) { - ret, _ = o.GetMachineTypeOk() - return ret -} - -// GetMachineTypeOk returns a tuple with the MachineType field value -// and a boolean to check if the value has been set. -func (o *ResizeServerPayload) GetMachineTypeOk() (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { - return getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) -} - -// SetMachineType sets field value -func (o *ResizeServerPayload) SetMachineType(v ResizeServerPayloadGetMachineTypeRetType) { - setResizeServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) -} - -func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType); ok { - toSerialize["MachineType"] = val - } - return toSerialize, nil -} - -type NullableResizeServerPayload struct { - value *ResizeServerPayload - isSet bool -} - -func (v NullableResizeServerPayload) Get() *ResizeServerPayload { - return v.value -} - -func (v *NullableResizeServerPayload) Set(val *ResizeServerPayload) { - v.value = val - v.isSet = true -} - -func (v NullableResizeServerPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableResizeServerPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableResizeServerPayload(val *ResizeServerPayload) *NullableResizeServerPayload { - return &NullableResizeServerPayload{value: val, isSet: true} -} - -func (v NullableResizeServerPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableResizeServerPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_resize_server_payload_test.go b/services/iaasalpha/model_resize_server_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_resize_server_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_resize_volume_payload.go b/services/iaasalpha/model_resize_volume_payload.go deleted file mode 100644 index aec29f5ea..000000000 --- a/services/iaasalpha/model_resize_volume_payload.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ResizeVolumePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ResizeVolumePayload{} - -/* - types and functions for size -*/ - -// isLong -type ResizeVolumePayloadGetSizeAttributeType = *int64 -type ResizeVolumePayloadGetSizeArgType = int64 -type ResizeVolumePayloadGetSizeRetType = int64 - -func getResizeVolumePayloadGetSizeAttributeTypeOk(arg ResizeVolumePayloadGetSizeAttributeType) (ret ResizeVolumePayloadGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setResizeVolumePayloadGetSizeAttributeType(arg *ResizeVolumePayloadGetSizeAttributeType, val ResizeVolumePayloadGetSizeRetType) { - *arg = &val -} - -// ResizeVolumePayload struct for ResizeVolumePayload -type ResizeVolumePayload struct { - // Size in Gigabyte. - // REQUIRED - Size ResizeVolumePayloadGetSizeAttributeType `json:"size" required:"true"` -} - -type _ResizeVolumePayload ResizeVolumePayload - -// NewResizeVolumePayload instantiates a new ResizeVolumePayload 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 NewResizeVolumePayload(size ResizeVolumePayloadGetSizeArgType) *ResizeVolumePayload { - this := ResizeVolumePayload{} - setResizeVolumePayloadGetSizeAttributeType(&this.Size, size) - return &this -} - -// NewResizeVolumePayloadWithDefaults instantiates a new ResizeVolumePayload 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 NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { - this := ResizeVolumePayload{} - return &this -} - -// GetSize returns the Size field value -func (o *ResizeVolumePayload) GetSize() (ret ResizeVolumePayloadGetSizeRetType) { - ret, _ = o.GetSizeOk() - return ret -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *ResizeVolumePayload) GetSizeOk() (ret ResizeVolumePayloadGetSizeRetType, ok bool) { - return getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size) -} - -// SetSize sets field value -func (o *ResizeVolumePayload) SetSize(v ResizeVolumePayloadGetSizeRetType) { - setResizeVolumePayloadGetSizeAttributeType(&o.Size, v) -} - -func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - return toSerialize, nil -} - -type NullableResizeVolumePayload struct { - value *ResizeVolumePayload - isSet bool -} - -func (v NullableResizeVolumePayload) Get() *ResizeVolumePayload { - return v.value -} - -func (v *NullableResizeVolumePayload) Set(val *ResizeVolumePayload) { - v.value = val - v.isSet = true -} - -func (v NullableResizeVolumePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableResizeVolumePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableResizeVolumePayload(val *ResizeVolumePayload) *NullableResizeVolumePayload { - return &NullableResizeVolumePayload{value: val, isSet: true} -} - -func (v NullableResizeVolumePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableResizeVolumePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_resize_volume_payload_test.go b/services/iaasalpha/model_resize_volume_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_resize_volume_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_route.go b/services/iaasalpha/model_route.go index 0725aafaf..d58b742ad 100644 --- a/services/iaasalpha/model_route.go +++ b/services/iaasalpha/model_route.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // 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: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. 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/iaasalpha/model_route_destination.go b/services/iaasalpha/model_route_destination.go new file mode 100644 index 000000000..63e5c9a5e --- /dev/null +++ b/services/iaasalpha/model_route_destination.go @@ -0,0 +1,145 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 + match := 0 + // try to unmarshal data into DestinationCIDRv4 + err = newStrictDecoder(data).Decode(&dst.DestinationCIDRv4) + if err == nil { + jsonDestinationCIDRv4, _ := json.Marshal(dst.DestinationCIDRv4) + if string(jsonDestinationCIDRv4) == "{}" { // empty struct + dst.DestinationCIDRv4 = nil + } else { + match++ + } + } else { + dst.DestinationCIDRv4 = nil + } + + // try to unmarshal data into DestinationCIDRv6 + err = newStrictDecoder(data).Decode(&dst.DestinationCIDRv6) + if err == nil { + jsonDestinationCIDRv6, _ := json.Marshal(dst.DestinationCIDRv6) + if string(jsonDestinationCIDRv6) == "{}" { // empty struct + dst.DestinationCIDRv6 = nil + } else { + match++ + } + } else { + dst.DestinationCIDRv6 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.DestinationCIDRv4 = nil + dst.DestinationCIDRv6 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RouteDestination)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RouteDestination)") + } +} + +// 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/iaasalpha/model_route_destination_test.go b/services/iaasalpha/model_route_destination_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_route_destination_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_route_list_response.go b/services/iaasalpha/model_route_list_response.go index a31b668e4..217510e17 100644 --- a/services/iaasalpha/model_route_list_response.go +++ b/services/iaasalpha/model_route_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_route_list_response_test.go b/services/iaasalpha/model_route_list_response_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_route_list_response_test.go +++ b/services/iaasalpha/model_route_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_route_nexthop.go b/services/iaasalpha/model_route_nexthop.go new file mode 100644 index 000000000..26a34cdd8 --- /dev/null +++ b/services/iaasalpha/model_route_nexthop.go @@ -0,0 +1,205 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 + match := 0 + // try to unmarshal data into NexthopBlackhole + err = newStrictDecoder(data).Decode(&dst.NexthopBlackhole) + if err == nil { + jsonNexthopBlackhole, _ := json.Marshal(dst.NexthopBlackhole) + if string(jsonNexthopBlackhole) == "{}" { // empty struct + dst.NexthopBlackhole = nil + } else { + match++ + } + } else { + dst.NexthopBlackhole = nil + } + + // try to unmarshal data into NexthopIPv4 + err = newStrictDecoder(data).Decode(&dst.NexthopIPv4) + if err == nil { + jsonNexthopIPv4, _ := json.Marshal(dst.NexthopIPv4) + if string(jsonNexthopIPv4) == "{}" { // empty struct + dst.NexthopIPv4 = nil + } else { + match++ + } + } else { + dst.NexthopIPv4 = nil + } + + // try to unmarshal data into NexthopIPv6 + err = newStrictDecoder(data).Decode(&dst.NexthopIPv6) + if err == nil { + jsonNexthopIPv6, _ := json.Marshal(dst.NexthopIPv6) + if string(jsonNexthopIPv6) == "{}" { // empty struct + dst.NexthopIPv6 = nil + } else { + match++ + } + } else { + dst.NexthopIPv6 = nil + } + + // try to unmarshal data into NexthopInternet + err = newStrictDecoder(data).Decode(&dst.NexthopInternet) + if err == nil { + jsonNexthopInternet, _ := json.Marshal(dst.NexthopInternet) + if string(jsonNexthopInternet) == "{}" { // empty struct + dst.NexthopInternet = nil + } else { + match++ + } + } else { + dst.NexthopInternet = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.NexthopBlackhole = nil + dst.NexthopIPv4 = nil + dst.NexthopIPv6 = nil + dst.NexthopInternet = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RouteNexthop)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RouteNexthop)") + } +} + +// 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/iaasalpha/model_route_nexthop_test.go b/services/iaasalpha/model_route_nexthop_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_route_nexthop_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_route_test.go b/services/iaasalpha/model_route_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_route_test.go +++ b/services/iaasalpha/model_route_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_routing_table.go b/services/iaasalpha/model_routing_table.go new file mode 100644 index 000000000..21530b83c --- /dev/null +++ b/services/iaasalpha/model_routing_table.go @@ -0,0 +1,467 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 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 for this area. 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"` + // Universally Unique Identifier (UUID). + Id RoutingTableGetIdAttributeType `json:"id,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. + 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 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) +} + +// 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 := 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/iaasalpha/model_routing_table_list_response.go b/services/iaasalpha/model_routing_table_list_response.go new file mode 100644 index 000000000..48d76eff7 --- /dev/null +++ b/services/iaasalpha/model_routing_table_list_response.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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/iaasalpha/model_routing_table_list_response_test.go b/services/iaasalpha/model_routing_table_list_response_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_routing_table_test.go b/services/iaasalpha/model_routing_table_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/model_routing_table_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_security_group.go b/services/iaasalpha/model_security_group.go deleted file mode 100644 index d296574ad..000000000 --- a/services/iaasalpha/model_security_group.go +++ /dev/null @@ -1,468 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the SecurityGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SecurityGroup{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type SecurityGroupGetCreatedAtAttributeType = *time.Time -type SecurityGroupGetCreatedAtArgType = time.Time -type SecurityGroupGetCreatedAtRetType = time.Time - -func getSecurityGroupGetCreatedAtAttributeTypeOk(arg SecurityGroupGetCreatedAtAttributeType) (ret SecurityGroupGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetCreatedAtAttributeType(arg *SecurityGroupGetCreatedAtAttributeType, val SecurityGroupGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -type SecurityGroupGetDescriptionAttributeType = *string - -func getSecurityGroupGetDescriptionAttributeTypeOk(arg SecurityGroupGetDescriptionAttributeType) (ret SecurityGroupGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetDescriptionAttributeType(arg *SecurityGroupGetDescriptionAttributeType, val SecurityGroupGetDescriptionRetType) { - *arg = &val -} - -type SecurityGroupGetDescriptionArgType = string -type SecurityGroupGetDescriptionRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type SecurityGroupGetIdAttributeType = *string - -func getSecurityGroupGetIdAttributeTypeOk(arg SecurityGroupGetIdAttributeType) (ret SecurityGroupGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetIdAttributeType(arg *SecurityGroupGetIdAttributeType, val SecurityGroupGetIdRetType) { - *arg = &val -} - -type SecurityGroupGetIdArgType = string -type SecurityGroupGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type SecurityGroupGetLabelsAttributeType = *map[string]interface{} -type SecurityGroupGetLabelsArgType = map[string]interface{} -type SecurityGroupGetLabelsRetType = map[string]interface{} - -func getSecurityGroupGetLabelsAttributeTypeOk(arg SecurityGroupGetLabelsAttributeType) (ret SecurityGroupGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetLabelsAttributeType(arg *SecurityGroupGetLabelsAttributeType, val SecurityGroupGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type SecurityGroupGetNameAttributeType = *string - -func getSecurityGroupGetNameAttributeTypeOk(arg SecurityGroupGetNameAttributeType) (ret SecurityGroupGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetNameAttributeType(arg *SecurityGroupGetNameAttributeType, val SecurityGroupGetNameRetType) { - *arg = &val -} - -type SecurityGroupGetNameArgType = string -type SecurityGroupGetNameRetType = string - -/* - types and functions for rules -*/ - -// isArray -type SecurityGroupGetRulesAttributeType = *[]SecurityGroupRule -type SecurityGroupGetRulesArgType = []SecurityGroupRule -type SecurityGroupGetRulesRetType = []SecurityGroupRule - -func getSecurityGroupGetRulesAttributeTypeOk(arg SecurityGroupGetRulesAttributeType) (ret SecurityGroupGetRulesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetRulesAttributeType(arg *SecurityGroupGetRulesAttributeType, val SecurityGroupGetRulesRetType) { - *arg = &val -} - -/* - types and functions for stateful -*/ - -// isBoolean -type SecurityGroupgetStatefulAttributeType = *bool -type SecurityGroupgetStatefulArgType = bool -type SecurityGroupgetStatefulRetType = bool - -func getSecurityGroupgetStatefulAttributeTypeOk(arg SecurityGroupgetStatefulAttributeType) (ret SecurityGroupgetStatefulRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupgetStatefulAttributeType(arg *SecurityGroupgetStatefulAttributeType, val SecurityGroupgetStatefulRetType) { - *arg = &val -} - -/* - types and functions for updatedAt -*/ - -// isDateTime -type SecurityGroupGetUpdatedAtAttributeType = *time.Time -type SecurityGroupGetUpdatedAtArgType = time.Time -type SecurityGroupGetUpdatedAtRetType = time.Time - -func getSecurityGroupGetUpdatedAtAttributeTypeOk(arg SecurityGroupGetUpdatedAtAttributeType) (ret SecurityGroupGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupGetUpdatedAtAttributeType(arg *SecurityGroupGetUpdatedAtAttributeType, val SecurityGroupGetUpdatedAtRetType) { - *arg = &val -} - -// SecurityGroup Object that represents a security group. -type SecurityGroup struct { - // Date-time when resource was created. - CreatedAt SecurityGroupGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description SecurityGroupGetDescriptionAttributeType `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id SecurityGroupGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels SecurityGroupGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name SecurityGroupGetNameAttributeType `json:"name" required:"true"` - // A list containing security group rule objects. - Rules SecurityGroupGetRulesAttributeType `json:"rules,omitempty"` - // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. - Stateful SecurityGroupgetStatefulAttributeType `json:"stateful,omitempty"` - // Date-time when resource was last updated. - UpdatedAt SecurityGroupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _SecurityGroup SecurityGroup - -// NewSecurityGroup instantiates a new SecurityGroup 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 NewSecurityGroup(name SecurityGroupGetNameArgType) *SecurityGroup { - this := SecurityGroup{} - setSecurityGroupGetNameAttributeType(&this.Name, name) - return &this -} - -// NewSecurityGroupWithDefaults instantiates a new SecurityGroup 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 NewSecurityGroupWithDefaults() *SecurityGroup { - this := SecurityGroup{} - var stateful bool = true - this.Stateful = &stateful - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *SecurityGroup) GetCreatedAt() (res SecurityGroupGetCreatedAtRetType) { - 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 *SecurityGroup) GetCreatedAtOk() (ret SecurityGroupGetCreatedAtRetType, ok bool) { - return getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *SecurityGroup) 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 *SecurityGroup) SetCreatedAt(v SecurityGroupGetCreatedAtRetType) { - setSecurityGroupGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *SecurityGroup) GetDescription() (res SecurityGroupGetDescriptionRetType) { - 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 *SecurityGroup) GetDescriptionOk() (ret SecurityGroupGetDescriptionRetType, ok bool) { - return getSecurityGroupGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *SecurityGroup) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *SecurityGroup) SetDescription(v SecurityGroupGetDescriptionRetType) { - setSecurityGroupGetDescriptionAttributeType(&o.Description, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *SecurityGroup) GetId() (res SecurityGroupGetIdRetType) { - 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 *SecurityGroup) GetIdOk() (ret SecurityGroupGetIdRetType, ok bool) { - return getSecurityGroupGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *SecurityGroup) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *SecurityGroup) SetId(v SecurityGroupGetIdRetType) { - setSecurityGroupGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *SecurityGroup) GetLabels() (res SecurityGroupGetLabelsRetType) { - 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 *SecurityGroup) GetLabelsOk() (ret SecurityGroupGetLabelsRetType, ok bool) { - return getSecurityGroupGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *SecurityGroup) 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 *SecurityGroup) SetLabels(v SecurityGroupGetLabelsRetType) { - setSecurityGroupGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value -func (o *SecurityGroup) GetName() (ret SecurityGroupGetNameRetType) { - 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 *SecurityGroup) GetNameOk() (ret SecurityGroupGetNameRetType, ok bool) { - return getSecurityGroupGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *SecurityGroup) SetName(v SecurityGroupGetNameRetType) { - setSecurityGroupGetNameAttributeType(&o.Name, v) -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *SecurityGroup) GetRules() (res SecurityGroupGetRulesRetType) { - res, _ = o.GetRulesOk() - return -} - -// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroup) GetRulesOk() (ret SecurityGroupGetRulesRetType, ok bool) { - return getSecurityGroupGetRulesAttributeTypeOk(o.Rules) -} - -// HasRules returns a boolean if a field has been set. -func (o *SecurityGroup) HasRules() bool { - _, ok := o.GetRulesOk() - return ok -} - -// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. -func (o *SecurityGroup) SetRules(v SecurityGroupGetRulesRetType) { - setSecurityGroupGetRulesAttributeType(&o.Rules, v) -} - -// GetStateful returns the Stateful field value if set, zero value otherwise. -func (o *SecurityGroup) GetStateful() (res SecurityGroupgetStatefulRetType) { - res, _ = o.GetStatefulOk() - return -} - -// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroup) GetStatefulOk() (ret SecurityGroupgetStatefulRetType, ok bool) { - return getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful) -} - -// HasStateful returns a boolean if a field has been set. -func (o *SecurityGroup) HasStateful() bool { - _, ok := o.GetStatefulOk() - return ok -} - -// SetStateful gets a reference to the given bool and assigns it to the Stateful field. -func (o *SecurityGroup) SetStateful(v SecurityGroupgetStatefulRetType) { - setSecurityGroupgetStatefulAttributeType(&o.Stateful, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *SecurityGroup) GetUpdatedAt() (res SecurityGroupGetUpdatedAtRetType) { - 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 *SecurityGroup) GetUpdatedAtOk() (ret SecurityGroupGetUpdatedAtRetType, ok bool) { - return getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *SecurityGroup) 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 *SecurityGroup) SetUpdatedAt(v SecurityGroupGetUpdatedAtRetType) { - setSecurityGroupGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o SecurityGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getSecurityGroupGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getSecurityGroupGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getSecurityGroupGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getSecurityGroupGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getSecurityGroupGetRulesAttributeTypeOk(o.Rules); ok { - toSerialize["Rules"] = val - } - if val, ok := getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful); ok { - toSerialize["Stateful"] = val - } - if val, ok := getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableSecurityGroup struct { - value *SecurityGroup - isSet bool -} - -func (v NullableSecurityGroup) Get() *SecurityGroup { - return v.value -} - -func (v *NullableSecurityGroup) Set(val *SecurityGroup) { - v.value = val - v.isSet = true -} - -func (v NullableSecurityGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableSecurityGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup { - return &NullableSecurityGroup{value: val, isSet: true} -} - -func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_security_group_list_response.go b/services/iaasalpha/model_security_group_list_response.go deleted file mode 100644 index 8217feafd..000000000 --- a/services/iaasalpha/model_security_group_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SecurityGroupListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SecurityGroupListResponse{} - -/* - types and functions for items -*/ - -// isArray -type SecurityGroupListResponseGetItemsAttributeType = *[]SecurityGroup -type SecurityGroupListResponseGetItemsArgType = []SecurityGroup -type SecurityGroupListResponseGetItemsRetType = []SecurityGroup - -func getSecurityGroupListResponseGetItemsAttributeTypeOk(arg SecurityGroupListResponseGetItemsAttributeType) (ret SecurityGroupListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupListResponseGetItemsAttributeType(arg *SecurityGroupListResponseGetItemsAttributeType, val SecurityGroupListResponseGetItemsRetType) { - *arg = &val -} - -// SecurityGroupListResponse Security group list response. -type SecurityGroupListResponse struct { - // A list containing security group objects. - // REQUIRED - Items SecurityGroupListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _SecurityGroupListResponse SecurityGroupListResponse - -// NewSecurityGroupListResponse instantiates a new SecurityGroupListResponse 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 NewSecurityGroupListResponse(items SecurityGroupListResponseGetItemsArgType) *SecurityGroupListResponse { - this := SecurityGroupListResponse{} - setSecurityGroupListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewSecurityGroupListResponseWithDefaults instantiates a new SecurityGroupListResponse 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 NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { - this := SecurityGroupListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *SecurityGroupListResponse) GetItems() (ret SecurityGroupListResponseGetItemsRetType) { - 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 *SecurityGroupListResponse) GetItemsOk() (ret SecurityGroupListResponseGetItemsRetType, ok bool) { - return getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *SecurityGroupListResponse) SetItems(v SecurityGroupListResponseGetItemsRetType) { - setSecurityGroupListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableSecurityGroupListResponse struct { - value *SecurityGroupListResponse - isSet bool -} - -func (v NullableSecurityGroupListResponse) Get() *SecurityGroupListResponse { - return v.value -} - -func (v *NullableSecurityGroupListResponse) Set(val *SecurityGroupListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableSecurityGroupListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableSecurityGroupListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecurityGroupListResponse(val *SecurityGroupListResponse) *NullableSecurityGroupListResponse { - return &NullableSecurityGroupListResponse{value: val, isSet: true} -} - -func (v NullableSecurityGroupListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecurityGroupListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_security_group_list_response_test.go b/services/iaasalpha/model_security_group_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_security_group_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_security_group_rule.go b/services/iaasalpha/model_security_group_rule.go deleted file mode 100644 index 97a9b060c..000000000 --- a/services/iaasalpha/model_security_group_rule.go +++ /dev/null @@ -1,564 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SecurityGroupRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SecurityGroupRule{} - -/* - types and functions for description -*/ - -// isNotNullableString -type SecurityGroupRuleGetDescriptionAttributeType = *string - -func getSecurityGroupRuleGetDescriptionAttributeTypeOk(arg SecurityGroupRuleGetDescriptionAttributeType) (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetDescriptionAttributeType(arg *SecurityGroupRuleGetDescriptionAttributeType, val SecurityGroupRuleGetDescriptionRetType) { - *arg = &val -} - -type SecurityGroupRuleGetDescriptionArgType = string -type SecurityGroupRuleGetDescriptionRetType = string - -/* - types and functions for direction -*/ - -// isNotNullableString -type SecurityGroupRuleGetDirectionAttributeType = *string - -func getSecurityGroupRuleGetDirectionAttributeTypeOk(arg SecurityGroupRuleGetDirectionAttributeType) (ret SecurityGroupRuleGetDirectionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetDirectionAttributeType(arg *SecurityGroupRuleGetDirectionAttributeType, val SecurityGroupRuleGetDirectionRetType) { - *arg = &val -} - -type SecurityGroupRuleGetDirectionArgType = string -type SecurityGroupRuleGetDirectionRetType = string - -/* - types and functions for ethertype -*/ - -// isNotNullableString -type SecurityGroupRuleGetEthertypeAttributeType = *string - -func getSecurityGroupRuleGetEthertypeAttributeTypeOk(arg SecurityGroupRuleGetEthertypeAttributeType) (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetEthertypeAttributeType(arg *SecurityGroupRuleGetEthertypeAttributeType, val SecurityGroupRuleGetEthertypeRetType) { - *arg = &val -} - -type SecurityGroupRuleGetEthertypeArgType = string -type SecurityGroupRuleGetEthertypeRetType = string - -/* - types and functions for icmpParameters -*/ - -// isModel -type SecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters -type SecurityGroupRuleGetIcmpParametersArgType = ICMPParameters -type SecurityGroupRuleGetIcmpParametersRetType = ICMPParameters - -func getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg SecurityGroupRuleGetIcmpParametersAttributeType) (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetIcmpParametersAttributeType(arg *SecurityGroupRuleGetIcmpParametersAttributeType, val SecurityGroupRuleGetIcmpParametersRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type SecurityGroupRuleGetIdAttributeType = *string - -func getSecurityGroupRuleGetIdAttributeTypeOk(arg SecurityGroupRuleGetIdAttributeType) (ret SecurityGroupRuleGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetIdAttributeType(arg *SecurityGroupRuleGetIdAttributeType, val SecurityGroupRuleGetIdRetType) { - *arg = &val -} - -type SecurityGroupRuleGetIdArgType = string -type SecurityGroupRuleGetIdRetType = string - -/* - types and functions for ipRange -*/ - -// isNotNullableString -type SecurityGroupRuleGetIpRangeAttributeType = *string - -func getSecurityGroupRuleGetIpRangeAttributeTypeOk(arg SecurityGroupRuleGetIpRangeAttributeType) (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetIpRangeAttributeType(arg *SecurityGroupRuleGetIpRangeAttributeType, val SecurityGroupRuleGetIpRangeRetType) { - *arg = &val -} - -type SecurityGroupRuleGetIpRangeArgType = string -type SecurityGroupRuleGetIpRangeRetType = string - -/* - types and functions for portRange -*/ - -// isModel -type SecurityGroupRuleGetPortRangeAttributeType = *PortRange -type SecurityGroupRuleGetPortRangeArgType = PortRange -type SecurityGroupRuleGetPortRangeRetType = PortRange - -func getSecurityGroupRuleGetPortRangeAttributeTypeOk(arg SecurityGroupRuleGetPortRangeAttributeType) (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetPortRangeAttributeType(arg *SecurityGroupRuleGetPortRangeAttributeType, val SecurityGroupRuleGetPortRangeRetType) { - *arg = &val -} - -/* - types and functions for remoteSecurityGroupId -*/ - -// isNotNullableString -type SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string - -func getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - *arg = &val -} - -type SecurityGroupRuleGetRemoteSecurityGroupIdArgType = string -type SecurityGroupRuleGetRemoteSecurityGroupIdRetType = string - -/* - types and functions for securityGroupId -*/ - -// isNotNullableString -type SecurityGroupRuleGetSecurityGroupIdAttributeType = *string - -func getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetSecurityGroupIdAttributeType, val SecurityGroupRuleGetSecurityGroupIdRetType) { - *arg = &val -} - -type SecurityGroupRuleGetSecurityGroupIdArgType = string -type SecurityGroupRuleGetSecurityGroupIdRetType = string - -/* - types and functions for protocol -*/ - -// isModel -type SecurityGroupRuleGetProtocolAttributeType = *Protocol -type SecurityGroupRuleGetProtocolArgType = Protocol -type SecurityGroupRuleGetProtocolRetType = Protocol - -func getSecurityGroupRuleGetProtocolAttributeTypeOk(arg SecurityGroupRuleGetProtocolAttributeType) (ret SecurityGroupRuleGetProtocolRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleGetProtocolAttributeType(arg *SecurityGroupRuleGetProtocolAttributeType, val SecurityGroupRuleGetProtocolRetType) { - *arg = &val -} - -// SecurityGroupRule Object that represents a security group rule. -type SecurityGroupRule struct { - // Description Object. Allows string up to 255 Characters. - Description SecurityGroupRuleGetDescriptionAttributeType `json:"description,omitempty"` - // The direction of the traffic which the rule should match. - // REQUIRED - Direction SecurityGroupRuleGetDirectionAttributeType `json:"direction" required:"true"` - // The ethertype which the rule should match. - Ethertype SecurityGroupRuleGetEthertypeAttributeType `json:"ethertype,omitempty"` - IcmpParameters SecurityGroupRuleGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` - // Universally Unique Identifier (UUID). - Id SecurityGroupRuleGetIdAttributeType `json:"id,omitempty"` - // Classless Inter-Domain Routing (CIDR). - IpRange SecurityGroupRuleGetIpRangeAttributeType `json:"ipRange,omitempty"` - PortRange SecurityGroupRuleGetPortRangeAttributeType `json:"portRange,omitempty"` - // Universally Unique Identifier (UUID). - RemoteSecurityGroupId SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` - // Universally Unique Identifier (UUID). - SecurityGroupId SecurityGroupRuleGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` - Protocol SecurityGroupRuleGetProtocolAttributeType `json:"protocol,omitempty"` -} - -type _SecurityGroupRule SecurityGroupRule - -// NewSecurityGroupRule instantiates a new SecurityGroupRule 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 NewSecurityGroupRule(direction SecurityGroupRuleGetDirectionArgType) *SecurityGroupRule { - this := SecurityGroupRule{} - setSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) - return &this -} - -// NewSecurityGroupRuleWithDefaults instantiates a new SecurityGroupRule 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 NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { - this := SecurityGroupRule{} - var ethertype string = "IPv4" - this.Ethertype = ðertype - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetDescription() (res SecurityGroupRuleGetDescriptionRetType) { - 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 *SecurityGroupRule) GetDescriptionOk() (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { - return getSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *SecurityGroupRule) SetDescription(v SecurityGroupRuleGetDescriptionRetType) { - setSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) -} - -// GetDirection returns the Direction field value -func (o *SecurityGroupRule) GetDirection() (ret SecurityGroupRuleGetDirectionRetType) { - ret, _ = o.GetDirectionOk() - return ret -} - -// GetDirectionOk returns a tuple with the Direction field value -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetDirectionOk() (ret SecurityGroupRuleGetDirectionRetType, ok bool) { - return getSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) -} - -// SetDirection sets field value -func (o *SecurityGroupRule) SetDirection(v SecurityGroupRuleGetDirectionRetType) { - setSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) -} - -// GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetEthertype() (res SecurityGroupRuleGetEthertypeRetType) { - res, _ = o.GetEthertypeOk() - return -} - -// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetEthertypeOk() (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { - return getSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) -} - -// HasEthertype returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasEthertype() bool { - _, ok := o.GetEthertypeOk() - return ok -} - -// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *SecurityGroupRule) SetEthertype(v SecurityGroupRuleGetEthertypeRetType) { - setSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) -} - -// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetIcmpParameters() (res SecurityGroupRuleGetIcmpParametersRetType) { - res, _ = o.GetIcmpParametersOk() - return -} - -// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetIcmpParametersOk() (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { - return getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) -} - -// HasIcmpParameters returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasIcmpParameters() bool { - _, ok := o.GetIcmpParametersOk() - return ok -} - -// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *SecurityGroupRule) SetIcmpParameters(v SecurityGroupRuleGetIcmpParametersRetType) { - setSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetId() (res SecurityGroupRuleGetIdRetType) { - 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 *SecurityGroupRule) GetIdOk() (ret SecurityGroupRuleGetIdRetType, ok bool) { - return getSecurityGroupRuleGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *SecurityGroupRule) SetId(v SecurityGroupRuleGetIdRetType) { - setSecurityGroupRuleGetIdAttributeType(&o.Id, v) -} - -// GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetIpRange() (res SecurityGroupRuleGetIpRangeRetType) { - res, _ = o.GetIpRangeOk() - return -} - -// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetIpRangeOk() (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { - return getSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) -} - -// HasIpRange returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasIpRange() bool { - _, ok := o.GetIpRangeOk() - return ok -} - -// SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *SecurityGroupRule) SetIpRange(v SecurityGroupRuleGetIpRangeRetType) { - setSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) -} - -// GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetPortRange() (res SecurityGroupRuleGetPortRangeRetType) { - res, _ = o.GetPortRangeOk() - return -} - -// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetPortRangeOk() (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { - return getSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) -} - -// HasPortRange returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasPortRange() bool { - _, ok := o.GetPortRangeOk() - return ok -} - -// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *SecurityGroupRule) SetPortRange(v SecurityGroupRuleGetPortRangeRetType) { - setSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) -} - -// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetRemoteSecurityGroupId() (res SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - res, _ = o.GetRemoteSecurityGroupIdOk() - return -} - -// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { - return getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) -} - -// HasRemoteSecurityGroupId returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { - _, ok := o.GetRemoteSecurityGroupIdOk() - return ok -} - -// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { - setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) -} - -// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetSecurityGroupId() (res SecurityGroupRuleGetSecurityGroupIdRetType) { - res, _ = o.GetSecurityGroupIdOk() - return -} - -// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetSecurityGroupIdOk() (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { - return getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) -} - -// HasSecurityGroupId returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasSecurityGroupId() bool { - _, ok := o.GetSecurityGroupIdOk() - return ok -} - -// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *SecurityGroupRule) SetSecurityGroupId(v SecurityGroupRuleGetSecurityGroupIdRetType) { - setSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) -} - -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetProtocol() (res SecurityGroupRuleGetProtocolRetType) { - res, _ = o.GetProtocolOk() - return -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetProtocolOk() (ret SecurityGroupRuleGetProtocolRetType, ok bool) { - return getSecurityGroupRuleGetProtocolAttributeTypeOk(o.Protocol) -} - -// HasProtocol returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasProtocol() bool { - _, ok := o.GetProtocolOk() - return ok -} - -// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. -func (o *SecurityGroupRule) SetProtocol(v SecurityGroupRuleGetProtocolRetType) { - setSecurityGroupRuleGetProtocolAttributeType(&o.Protocol, v) -} - -func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction); ok { - toSerialize["Direction"] = val - } - if val, ok := getSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype); ok { - toSerialize["Ethertype"] = val - } - if val, ok := getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { - toSerialize["IcmpParameters"] = val - } - if val, ok := getSecurityGroupRuleGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange); ok { - toSerialize["IpRange"] = val - } - if val, ok := getSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange); ok { - toSerialize["PortRange"] = val - } - if val, ok := getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { - toSerialize["RemoteSecurityGroupId"] = val - } - if val, ok := getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { - toSerialize["SecurityGroupId"] = val - } - if val, ok := getSecurityGroupRuleGetProtocolAttributeTypeOk(o.Protocol); ok { - toSerialize["Protocol"] = val - } - return toSerialize, nil -} - -type NullableSecurityGroupRule struct { - value *SecurityGroupRule - isSet bool -} - -func (v NullableSecurityGroupRule) Get() *SecurityGroupRule { - return v.value -} - -func (v *NullableSecurityGroupRule) Set(val *SecurityGroupRule) { - v.value = val - v.isSet = true -} - -func (v NullableSecurityGroupRule) IsSet() bool { - return v.isSet -} - -func (v *NullableSecurityGroupRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecurityGroupRule(val *SecurityGroupRule) *NullableSecurityGroupRule { - return &NullableSecurityGroupRule{value: val, isSet: true} -} - -func (v NullableSecurityGroupRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecurityGroupRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_security_group_rule_list_response.go b/services/iaasalpha/model_security_group_rule_list_response.go deleted file mode 100644 index 61fc45906..000000000 --- a/services/iaasalpha/model_security_group_rule_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SecurityGroupRuleListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SecurityGroupRuleListResponse{} - -/* - types and functions for items -*/ - -// isArray -type SecurityGroupRuleListResponseGetItemsAttributeType = *[]SecurityGroupRule -type SecurityGroupRuleListResponseGetItemsArgType = []SecurityGroupRule -type SecurityGroupRuleListResponseGetItemsRetType = []SecurityGroupRule - -func getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(arg SecurityGroupRuleListResponseGetItemsAttributeType) (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleListResponseGetItemsAttributeType(arg *SecurityGroupRuleListResponseGetItemsAttributeType, val SecurityGroupRuleListResponseGetItemsRetType) { - *arg = &val -} - -// SecurityGroupRuleListResponse Security group rule list response. -type SecurityGroupRuleListResponse struct { - // A list containing security group rule objects. - // REQUIRED - Items SecurityGroupRuleListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse - -// NewSecurityGroupRuleListResponse instantiates a new SecurityGroupRuleListResponse 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 NewSecurityGroupRuleListResponse(items SecurityGroupRuleListResponseGetItemsArgType) *SecurityGroupRuleListResponse { - this := SecurityGroupRuleListResponse{} - setSecurityGroupRuleListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewSecurityGroupRuleListResponseWithDefaults instantiates a new SecurityGroupRuleListResponse 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 NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListResponse { - this := SecurityGroupRuleListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *SecurityGroupRuleListResponse) GetItems() (ret SecurityGroupRuleListResponseGetItemsRetType) { - 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 *SecurityGroupRuleListResponse) GetItemsOk() (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { - return getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *SecurityGroupRuleListResponse) SetItems(v SecurityGroupRuleListResponseGetItemsRetType) { - setSecurityGroupRuleListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableSecurityGroupRuleListResponse struct { - value *SecurityGroupRuleListResponse - isSet bool -} - -func (v NullableSecurityGroupRuleListResponse) Get() *SecurityGroupRuleListResponse { - return v.value -} - -func (v *NullableSecurityGroupRuleListResponse) Set(val *SecurityGroupRuleListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableSecurityGroupRuleListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableSecurityGroupRuleListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecurityGroupRuleListResponse(val *SecurityGroupRuleListResponse) *NullableSecurityGroupRuleListResponse { - return &NullableSecurityGroupRuleListResponse{value: val, isSet: true} -} - -func (v NullableSecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecurityGroupRuleListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_security_group_rule_list_response_test.go b/services/iaasalpha/model_security_group_rule_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_security_group_rule_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_security_group_rule_protocol.go b/services/iaasalpha/model_security_group_rule_protocol.go deleted file mode 100644 index 03e257c09..000000000 --- a/services/iaasalpha/model_security_group_rule_protocol.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SecurityGroupRuleProtocol{} - -/* - types and functions for protocol -*/ - -// isModel -type SecurityGroupRuleProtocolGetProtocolAttributeType = *Protocol -type SecurityGroupRuleProtocolGetProtocolArgType = Protocol -type SecurityGroupRuleProtocolGetProtocolRetType = Protocol - -func getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg SecurityGroupRuleProtocolGetProtocolAttributeType) (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSecurityGroupRuleProtocolGetProtocolAttributeType(arg *SecurityGroupRuleProtocolGetProtocolAttributeType, val SecurityGroupRuleProtocolGetProtocolRetType) { - *arg = &val -} - -// SecurityGroupRuleProtocol The internet protocol which the rule matches. -type SecurityGroupRuleProtocol struct { - Protocol SecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` -} - -// NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol 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 NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { - this := SecurityGroupRuleProtocol{} - return &this -} - -// NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol 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 NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { - this := SecurityGroupRuleProtocol{} - return &this -} - -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *SecurityGroupRuleProtocol) GetProtocol() (res SecurityGroupRuleProtocolGetProtocolRetType) { - res, _ = o.GetProtocolOk() - return -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRuleProtocol) GetProtocolOk() (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { - return getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) -} - -// HasProtocol returns a boolean if a field has been set. -func (o *SecurityGroupRuleProtocol) HasProtocol() bool { - _, ok := o.GetProtocolOk() - return ok -} - -// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. -func (o *SecurityGroupRuleProtocol) SetProtocol(v SecurityGroupRuleProtocolGetProtocolRetType) { - setSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) -} - -func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { - toSerialize["Protocol"] = val - } - return toSerialize, nil -} - -type NullableSecurityGroupRuleProtocol struct { - value *SecurityGroupRuleProtocol - isSet bool -} - -func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { - return v.value -} - -func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { - v.value = val - v.isSet = true -} - -func (v NullableSecurityGroupRuleProtocol) IsSet() bool { - return v.isSet -} - -func (v *NullableSecurityGroupRuleProtocol) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { - return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} -} - -func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_security_group_rule_protocol_test.go b/services/iaasalpha/model_security_group_rule_protocol_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_security_group_rule_protocol_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_security_group_rule_test.go b/services/iaasalpha/model_security_group_rule_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_security_group_rule_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_security_group_test.go b/services/iaasalpha/model_security_group_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_security_group_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_server.go b/services/iaasalpha/model_server.go deleted file mode 100644 index 022a07e40..000000000 --- a/services/iaasalpha/model_server.go +++ /dev/null @@ -1,1186 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Server type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Server{} - -/* - types and functions for affinityGroup -*/ - -// isNotNullableString -type ServerGetAffinityGroupAttributeType = *string - -func getServerGetAffinityGroupAttributeTypeOk(arg ServerGetAffinityGroupAttributeType) (ret ServerGetAffinityGroupRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetAffinityGroupAttributeType(arg *ServerGetAffinityGroupAttributeType, val ServerGetAffinityGroupRetType) { - *arg = &val -} - -type ServerGetAffinityGroupArgType = string -type ServerGetAffinityGroupRetType = string - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type ServerGetAvailabilityZoneAttributeType = *string - -func getServerGetAvailabilityZoneAttributeTypeOk(arg ServerGetAvailabilityZoneAttributeType) (ret ServerGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetAvailabilityZoneAttributeType(arg *ServerGetAvailabilityZoneAttributeType, val ServerGetAvailabilityZoneRetType) { - *arg = &val -} - -type ServerGetAvailabilityZoneArgType = string -type ServerGetAvailabilityZoneRetType = string - -/* - types and functions for bootVolume -*/ - -// isModel -type ServerGetBootVolumeAttributeType = *CreateServerPayloadBootVolume -type ServerGetBootVolumeArgType = CreateServerPayloadBootVolume -type ServerGetBootVolumeRetType = CreateServerPayloadBootVolume - -func getServerGetBootVolumeAttributeTypeOk(arg ServerGetBootVolumeAttributeType) (ret ServerGetBootVolumeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetBootVolumeAttributeType(arg *ServerGetBootVolumeAttributeType, val ServerGetBootVolumeRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type ServerGetCreatedAtAttributeType = *time.Time -type ServerGetCreatedAtArgType = time.Time -type ServerGetCreatedAtRetType = time.Time - -func getServerGetCreatedAtAttributeTypeOk(arg ServerGetCreatedAtAttributeType) (ret ServerGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetCreatedAtAttributeType(arg *ServerGetCreatedAtAttributeType, val ServerGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for errorMessage -*/ - -// isNotNullableString -type ServerGetErrorMessageAttributeType = *string - -func getServerGetErrorMessageAttributeTypeOk(arg ServerGetErrorMessageAttributeType) (ret ServerGetErrorMessageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetErrorMessageAttributeType(arg *ServerGetErrorMessageAttributeType, val ServerGetErrorMessageRetType) { - *arg = &val -} - -type ServerGetErrorMessageArgType = string -type ServerGetErrorMessageRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type ServerGetIdAttributeType = *string - -func getServerGetIdAttributeTypeOk(arg ServerGetIdAttributeType) (ret ServerGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetIdAttributeType(arg *ServerGetIdAttributeType, val ServerGetIdRetType) { - *arg = &val -} - -type ServerGetIdArgType = string -type ServerGetIdRetType = string - -/* - types and functions for imageId -*/ - -// isNotNullableString -type ServerGetImageIdAttributeType = *string - -func getServerGetImageIdAttributeTypeOk(arg ServerGetImageIdAttributeType) (ret ServerGetImageIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetImageIdAttributeType(arg *ServerGetImageIdAttributeType, val ServerGetImageIdRetType) { - *arg = &val -} - -type ServerGetImageIdArgType = string -type ServerGetImageIdRetType = string - -/* - types and functions for keypairName -*/ - -// isNotNullableString -type ServerGetKeypairNameAttributeType = *string - -func getServerGetKeypairNameAttributeTypeOk(arg ServerGetKeypairNameAttributeType) (ret ServerGetKeypairNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetKeypairNameAttributeType(arg *ServerGetKeypairNameAttributeType, val ServerGetKeypairNameRetType) { - *arg = &val -} - -type ServerGetKeypairNameArgType = string -type ServerGetKeypairNameRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type ServerGetLabelsAttributeType = *map[string]interface{} -type ServerGetLabelsArgType = map[string]interface{} -type ServerGetLabelsRetType = map[string]interface{} - -func getServerGetLabelsAttributeTypeOk(arg ServerGetLabelsAttributeType) (ret ServerGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetLabelsAttributeType(arg *ServerGetLabelsAttributeType, val ServerGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for launchedAt -*/ - -// isDateTime -type ServerGetLaunchedAtAttributeType = *time.Time -type ServerGetLaunchedAtArgType = time.Time -type ServerGetLaunchedAtRetType = time.Time - -func getServerGetLaunchedAtAttributeTypeOk(arg ServerGetLaunchedAtAttributeType) (ret ServerGetLaunchedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetLaunchedAtAttributeType(arg *ServerGetLaunchedAtAttributeType, val ServerGetLaunchedAtRetType) { - *arg = &val -} - -/* - types and functions for machineType -*/ - -// isNotNullableString -type ServerGetMachineTypeAttributeType = *string - -func getServerGetMachineTypeAttributeTypeOk(arg ServerGetMachineTypeAttributeType) (ret ServerGetMachineTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetMachineTypeAttributeType(arg *ServerGetMachineTypeAttributeType, val ServerGetMachineTypeRetType) { - *arg = &val -} - -type ServerGetMachineTypeArgType = string -type ServerGetMachineTypeRetType = string - -/* - types and functions for maintenanceWindow -*/ - -// isModel -type ServerGetMaintenanceWindowAttributeType = *ServerMaintenance -type ServerGetMaintenanceWindowArgType = ServerMaintenance -type ServerGetMaintenanceWindowRetType = ServerMaintenance - -func getServerGetMaintenanceWindowAttributeTypeOk(arg ServerGetMaintenanceWindowAttributeType) (ret ServerGetMaintenanceWindowRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetMaintenanceWindowAttributeType(arg *ServerGetMaintenanceWindowAttributeType, val ServerGetMaintenanceWindowRetType) { - *arg = &val -} - -/* - types and functions for metadata -*/ - -// isFreeform -type ServerGetMetadataAttributeType = *map[string]interface{} -type ServerGetMetadataArgType = map[string]interface{} -type ServerGetMetadataRetType = map[string]interface{} - -func getServerGetMetadataAttributeTypeOk(arg ServerGetMetadataAttributeType) (ret ServerGetMetadataRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetMetadataAttributeType(arg *ServerGetMetadataAttributeType, val ServerGetMetadataRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type ServerGetNameAttributeType = *string - -func getServerGetNameAttributeTypeOk(arg ServerGetNameAttributeType) (ret ServerGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetNameAttributeType(arg *ServerGetNameAttributeType, val ServerGetNameRetType) { - *arg = &val -} - -type ServerGetNameArgType = string -type ServerGetNameRetType = string - -/* - types and functions for networking -*/ - -// isModel -type ServerGetNetworkingAttributeType = *CreateServerPayloadNetworking -type ServerGetNetworkingArgType = CreateServerPayloadNetworking -type ServerGetNetworkingRetType = CreateServerPayloadNetworking - -func getServerGetNetworkingAttributeTypeOk(arg ServerGetNetworkingAttributeType) (ret ServerGetNetworkingRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetNetworkingAttributeType(arg *ServerGetNetworkingAttributeType, val ServerGetNetworkingRetType) { - *arg = &val -} - -/* - types and functions for nics -*/ - -// isArray -type ServerGetNicsAttributeType = *[]ServerNetwork -type ServerGetNicsArgType = []ServerNetwork -type ServerGetNicsRetType = []ServerNetwork - -func getServerGetNicsAttributeTypeOk(arg ServerGetNicsAttributeType) (ret ServerGetNicsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetNicsAttributeType(arg *ServerGetNicsAttributeType, val ServerGetNicsRetType) { - *arg = &val -} - -/* - types and functions for powerStatus -*/ - -// isNotNullableString -type ServerGetPowerStatusAttributeType = *string - -func getServerGetPowerStatusAttributeTypeOk(arg ServerGetPowerStatusAttributeType) (ret ServerGetPowerStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetPowerStatusAttributeType(arg *ServerGetPowerStatusAttributeType, val ServerGetPowerStatusRetType) { - *arg = &val -} - -type ServerGetPowerStatusArgType = string -type ServerGetPowerStatusRetType = string - -/* - types and functions for securityGroups -*/ - -// isArray -type ServerGetSecurityGroupsAttributeType = *[]string -type ServerGetSecurityGroupsArgType = []string -type ServerGetSecurityGroupsRetType = []string - -func getServerGetSecurityGroupsAttributeTypeOk(arg ServerGetSecurityGroupsAttributeType) (ret ServerGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetSecurityGroupsAttributeType(arg *ServerGetSecurityGroupsAttributeType, val ServerGetSecurityGroupsRetType) { - *arg = &val -} - -/* - types and functions for serviceAccountMails -*/ - -// isArray -type ServerGetServiceAccountMailsAttributeType = *[]string -type ServerGetServiceAccountMailsArgType = []string -type ServerGetServiceAccountMailsRetType = []string - -func getServerGetServiceAccountMailsAttributeTypeOk(arg ServerGetServiceAccountMailsAttributeType) (ret ServerGetServiceAccountMailsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetServiceAccountMailsAttributeType(arg *ServerGetServiceAccountMailsAttributeType, val ServerGetServiceAccountMailsRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type ServerGetStatusAttributeType = *string - -func getServerGetStatusAttributeTypeOk(arg ServerGetStatusAttributeType) (ret ServerGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetStatusAttributeType(arg *ServerGetStatusAttributeType, val ServerGetStatusRetType) { - *arg = &val -} - -type ServerGetStatusArgType = string -type ServerGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type ServerGetUpdatedAtAttributeType = *time.Time -type ServerGetUpdatedAtArgType = time.Time -type ServerGetUpdatedAtRetType = time.Time - -func getServerGetUpdatedAtAttributeTypeOk(arg ServerGetUpdatedAtAttributeType) (ret ServerGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetUpdatedAtAttributeType(arg *ServerGetUpdatedAtAttributeType, val ServerGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for userData -*/ - -// isByteArray -type ServerGetUserDataAttributeType = *[]byte -type ServerGetUserDataArgType = []byte -type ServerGetUserDataRetType = []byte - -func getServerGetUserDataAttributeTypeOk(arg ServerGetUserDataAttributeType) (ret ServerGetUserDataRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetUserDataAttributeType(arg *ServerGetUserDataAttributeType, val ServerGetUserDataRetType) { - *arg = &val -} - -/* - types and functions for volumes -*/ - -// isArray -type ServerGetVolumesAttributeType = *[]string -type ServerGetVolumesArgType = []string -type ServerGetVolumesRetType = []string - -func getServerGetVolumesAttributeTypeOk(arg ServerGetVolumesAttributeType) (ret ServerGetVolumesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerGetVolumesAttributeType(arg *ServerGetVolumesAttributeType, val ServerGetVolumesRetType) { - *arg = &val -} - -// Server Representation of a single server object. -type Server struct { - // Universally Unique Identifier (UUID). - AffinityGroup ServerGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` - // Object that represents an availability zone. - AvailabilityZone ServerGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` - BootVolume ServerGetBootVolumeAttributeType `json:"bootVolume,omitempty"` - // Date-time when resource was created. - CreatedAt ServerGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // An error message. - ErrorMessage ServerGetErrorMessageAttributeType `json:"errorMessage,omitempty"` - // Universally Unique Identifier (UUID). - Id ServerGetIdAttributeType `json:"id,omitempty"` - // Universally Unique Identifier (UUID). - ImageId ServerGetImageIdAttributeType `json:"imageId,omitempty"` - // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - KeypairName ServerGetKeypairNameAttributeType `json:"keypairName,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels ServerGetLabelsAttributeType `json:"labels,omitempty"` - // Date-time when resource was launched. - LaunchedAt ServerGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - MachineType ServerGetMachineTypeAttributeType `json:"machineType" required:"true"` - MaintenanceWindow ServerGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` - // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. - Metadata ServerGetMetadataAttributeType `json:"metadata,omitempty"` - // The name for a Server. - // REQUIRED - Name ServerGetNameAttributeType `json:"name" required:"true"` - Networking ServerGetNetworkingAttributeType `json:"networking,omitempty"` - // A list of networks attached to a server. - Nics ServerGetNicsAttributeType `json:"nics,omitempty"` - // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. - PowerStatus ServerGetPowerStatusAttributeType `json:"powerStatus,omitempty"` - // A list of General Objects. - SecurityGroups ServerGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` - // A list of service account mails. - ServiceAccountMails ServerGetServiceAccountMailsAttributeType `json:"serviceAccountMails,omitempty"` - // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. - Status ServerGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt ServerGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. - UserData ServerGetUserDataAttributeType `json:"userData,omitempty"` - // A list of UUIDs. - Volumes ServerGetVolumesAttributeType `json:"volumes,omitempty"` -} - -type _Server Server - -// NewServer instantiates a new Server 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 NewServer(machineType ServerGetMachineTypeArgType, name ServerGetNameArgType) *Server { - this := Server{} - setServerGetMachineTypeAttributeType(&this.MachineType, machineType) - setServerGetNameAttributeType(&this.Name, name) - return &this -} - -// NewServerWithDefaults instantiates a new Server 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 NewServerWithDefaults() *Server { - this := Server{} - return &this -} - -// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. -func (o *Server) GetAffinityGroup() (res ServerGetAffinityGroupRetType) { - res, _ = o.GetAffinityGroupOk() - return -} - -// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetAffinityGroupOk() (ret ServerGetAffinityGroupRetType, ok bool) { - return getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup) -} - -// HasAffinityGroup returns a boolean if a field has been set. -func (o *Server) HasAffinityGroup() bool { - _, ok := o.GetAffinityGroupOk() - return ok -} - -// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. -func (o *Server) SetAffinityGroup(v ServerGetAffinityGroupRetType) { - setServerGetAffinityGroupAttributeType(&o.AffinityGroup, v) -} - -// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *Server) GetAvailabilityZone() (res ServerGetAvailabilityZoneRetType) { - res, _ = o.GetAvailabilityZoneOk() - return -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetAvailabilityZoneOk() (ret ServerGetAvailabilityZoneRetType, ok bool) { - return getServerGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// HasAvailabilityZone returns a boolean if a field has been set. -func (o *Server) HasAvailabilityZone() bool { - _, ok := o.GetAvailabilityZoneOk() - return ok -} - -// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *Server) SetAvailabilityZone(v ServerGetAvailabilityZoneRetType) { - setServerGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetBootVolume returns the BootVolume field value if set, zero value otherwise. -func (o *Server) GetBootVolume() (res ServerGetBootVolumeRetType) { - res, _ = o.GetBootVolumeOk() - return -} - -// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetBootVolumeOk() (ret ServerGetBootVolumeRetType, ok bool) { - return getServerGetBootVolumeAttributeTypeOk(o.BootVolume) -} - -// HasBootVolume returns a boolean if a field has been set. -func (o *Server) HasBootVolume() bool { - _, ok := o.GetBootVolumeOk() - return ok -} - -// SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. -func (o *Server) SetBootVolume(v ServerGetBootVolumeRetType) { - setServerGetBootVolumeAttributeType(&o.BootVolume, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Server) GetCreatedAt() (res ServerGetCreatedAtRetType) { - 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 *Server) GetCreatedAtOk() (ret ServerGetCreatedAtRetType, ok bool) { - return getServerGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Server) 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 *Server) SetCreatedAt(v ServerGetCreatedAtRetType) { - setServerGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *Server) GetErrorMessage() (res ServerGetErrorMessageRetType) { - res, _ = o.GetErrorMessageOk() - return -} - -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetErrorMessageOk() (ret ServerGetErrorMessageRetType, ok bool) { - return getServerGetErrorMessageAttributeTypeOk(o.ErrorMessage) -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *Server) HasErrorMessage() bool { - _, ok := o.GetErrorMessageOk() - return ok -} - -// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *Server) SetErrorMessage(v ServerGetErrorMessageRetType) { - setServerGetErrorMessageAttributeType(&o.ErrorMessage, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Server) GetId() (res ServerGetIdRetType) { - 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 *Server) GetIdOk() (ret ServerGetIdRetType, ok bool) { - return getServerGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *Server) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Server) SetId(v ServerGetIdRetType) { - setServerGetIdAttributeType(&o.Id, v) -} - -// GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *Server) GetImageId() (res ServerGetImageIdRetType) { - res, _ = o.GetImageIdOk() - return -} - -// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetImageIdOk() (ret ServerGetImageIdRetType, ok bool) { - return getServerGetImageIdAttributeTypeOk(o.ImageId) -} - -// HasImageId returns a boolean if a field has been set. -func (o *Server) HasImageId() bool { - _, ok := o.GetImageIdOk() - return ok -} - -// SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *Server) SetImageId(v ServerGetImageIdRetType) { - setServerGetImageIdAttributeType(&o.ImageId, v) -} - -// GetKeypairName returns the KeypairName field value if set, zero value otherwise. -func (o *Server) GetKeypairName() (res ServerGetKeypairNameRetType) { - res, _ = o.GetKeypairNameOk() - return -} - -// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetKeypairNameOk() (ret ServerGetKeypairNameRetType, ok bool) { - return getServerGetKeypairNameAttributeTypeOk(o.KeypairName) -} - -// HasKeypairName returns a boolean if a field has been set. -func (o *Server) HasKeypairName() bool { - _, ok := o.GetKeypairNameOk() - return ok -} - -// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. -func (o *Server) SetKeypairName(v ServerGetKeypairNameRetType) { - setServerGetKeypairNameAttributeType(&o.KeypairName, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Server) GetLabels() (res ServerGetLabelsRetType) { - 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 *Server) GetLabelsOk() (ret ServerGetLabelsRetType, ok bool) { - return getServerGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Server) 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 *Server) SetLabels(v ServerGetLabelsRetType) { - setServerGetLabelsAttributeType(&o.Labels, v) -} - -// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. -func (o *Server) GetLaunchedAt() (res ServerGetLaunchedAtRetType) { - res, _ = o.GetLaunchedAtOk() - return -} - -// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetLaunchedAtOk() (ret ServerGetLaunchedAtRetType, ok bool) { - return getServerGetLaunchedAtAttributeTypeOk(o.LaunchedAt) -} - -// HasLaunchedAt returns a boolean if a field has been set. -func (o *Server) HasLaunchedAt() bool { - _, ok := o.GetLaunchedAtOk() - return ok -} - -// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. -func (o *Server) SetLaunchedAt(v ServerGetLaunchedAtRetType) { - setServerGetLaunchedAtAttributeType(&o.LaunchedAt, v) -} - -// GetMachineType returns the MachineType field value -func (o *Server) GetMachineType() (ret ServerGetMachineTypeRetType) { - ret, _ = o.GetMachineTypeOk() - return ret -} - -// GetMachineTypeOk returns a tuple with the MachineType field value -// and a boolean to check if the value has been set. -func (o *Server) GetMachineTypeOk() (ret ServerGetMachineTypeRetType, ok bool) { - return getServerGetMachineTypeAttributeTypeOk(o.MachineType) -} - -// SetMachineType sets field value -func (o *Server) SetMachineType(v ServerGetMachineTypeRetType) { - setServerGetMachineTypeAttributeType(&o.MachineType, v) -} - -// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. -func (o *Server) GetMaintenanceWindow() (res ServerGetMaintenanceWindowRetType) { - res, _ = o.GetMaintenanceWindowOk() - return -} - -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetMaintenanceWindowOk() (ret ServerGetMaintenanceWindowRetType, ok bool) { - return getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) -} - -// HasMaintenanceWindow returns a boolean if a field has been set. -func (o *Server) HasMaintenanceWindow() bool { - _, ok := o.GetMaintenanceWindowOk() - return ok -} - -// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. -func (o *Server) SetMaintenanceWindow(v ServerGetMaintenanceWindowRetType) { - setServerGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *Server) GetMetadata() (res ServerGetMetadataRetType) { - res, _ = o.GetMetadataOk() - return -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetMetadataOk() (ret ServerGetMetadataRetType, ok bool) { - return getServerGetMetadataAttributeTypeOk(o.Metadata) -} - -// HasMetadata returns a boolean if a field has been set. -func (o *Server) HasMetadata() bool { - _, ok := o.GetMetadataOk() - return ok -} - -// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. -func (o *Server) SetMetadata(v ServerGetMetadataRetType) { - setServerGetMetadataAttributeType(&o.Metadata, v) -} - -// GetName returns the Name field value -func (o *Server) GetName() (ret ServerGetNameRetType) { - 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 *Server) GetNameOk() (ret ServerGetNameRetType, ok bool) { - return getServerGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *Server) SetName(v ServerGetNameRetType) { - setServerGetNameAttributeType(&o.Name, v) -} - -// GetNetworking returns the Networking field value if set, zero value otherwise. -func (o *Server) GetNetworking() (res ServerGetNetworkingRetType) { - res, _ = o.GetNetworkingOk() - return -} - -// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetNetworkingOk() (ret ServerGetNetworkingRetType, ok bool) { - return getServerGetNetworkingAttributeTypeOk(o.Networking) -} - -// HasNetworking returns a boolean if a field has been set. -func (o *Server) HasNetworking() bool { - _, ok := o.GetNetworkingOk() - return ok -} - -// SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. -func (o *Server) SetNetworking(v ServerGetNetworkingRetType) { - setServerGetNetworkingAttributeType(&o.Networking, v) -} - -// GetNics returns the Nics field value if set, zero value otherwise. -func (o *Server) GetNics() (res ServerGetNicsRetType) { - res, _ = o.GetNicsOk() - return -} - -// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetNicsOk() (ret ServerGetNicsRetType, ok bool) { - return getServerGetNicsAttributeTypeOk(o.Nics) -} - -// HasNics returns a boolean if a field has been set. -func (o *Server) HasNics() bool { - _, ok := o.GetNicsOk() - return ok -} - -// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. -func (o *Server) SetNics(v ServerGetNicsRetType) { - setServerGetNicsAttributeType(&o.Nics, v) -} - -// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. -func (o *Server) GetPowerStatus() (res ServerGetPowerStatusRetType) { - res, _ = o.GetPowerStatusOk() - return -} - -// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetPowerStatusOk() (ret ServerGetPowerStatusRetType, ok bool) { - return getServerGetPowerStatusAttributeTypeOk(o.PowerStatus) -} - -// HasPowerStatus returns a boolean if a field has been set. -func (o *Server) HasPowerStatus() bool { - _, ok := o.GetPowerStatusOk() - return ok -} - -// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. -func (o *Server) SetPowerStatus(v ServerGetPowerStatusRetType) { - setServerGetPowerStatusAttributeType(&o.PowerStatus, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *Server) GetSecurityGroups() (res ServerGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetSecurityGroupsOk() (ret ServerGetSecurityGroupsRetType, ok bool) { - return getServerGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *Server) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *Server) SetSecurityGroups(v ServerGetSecurityGroupsRetType) { - setServerGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. -func (o *Server) GetServiceAccountMails() (res ServerGetServiceAccountMailsRetType) { - res, _ = o.GetServiceAccountMailsOk() - return -} - -// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetServiceAccountMailsOk() (ret ServerGetServiceAccountMailsRetType, ok bool) { - return getServerGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) -} - -// HasServiceAccountMails returns a boolean if a field has been set. -func (o *Server) HasServiceAccountMails() bool { - _, ok := o.GetServiceAccountMailsOk() - return ok -} - -// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. -func (o *Server) SetServiceAccountMails(v ServerGetServiceAccountMailsRetType) { - setServerGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Server) GetStatus() (res ServerGetStatusRetType) { - 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 *Server) GetStatusOk() (ret ServerGetStatusRetType, ok bool) { - return getServerGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *Server) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Server) SetStatus(v ServerGetStatusRetType) { - setServerGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Server) GetUpdatedAt() (res ServerGetUpdatedAtRetType) { - 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 *Server) GetUpdatedAtOk() (ret ServerGetUpdatedAtRetType, ok bool) { - return getServerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Server) 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 *Server) SetUpdatedAt(v ServerGetUpdatedAtRetType) { - setServerGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetUserData returns the UserData field value if set, zero value otherwise. -func (o *Server) GetUserData() (res ServerGetUserDataRetType) { - res, _ = o.GetUserDataOk() - return -} - -// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetUserDataOk() (ret ServerGetUserDataRetType, ok bool) { - return getServerGetUserDataAttributeTypeOk(o.UserData) -} - -// HasUserData returns a boolean if a field has been set. -func (o *Server) HasUserData() bool { - _, ok := o.GetUserDataOk() - return ok -} - -// SetUserData gets a reference to the given string and assigns it to the UserData field. -func (o *Server) SetUserData(v ServerGetUserDataRetType) { - setServerGetUserDataAttributeType(&o.UserData, v) -} - -// GetVolumes returns the Volumes field value if set, zero value otherwise. -func (o *Server) GetVolumes() (res ServerGetVolumesRetType) { - res, _ = o.GetVolumesOk() - return -} - -// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetVolumesOk() (ret ServerGetVolumesRetType, ok bool) { - return getServerGetVolumesAttributeTypeOk(o.Volumes) -} - -// HasVolumes returns a boolean if a field has been set. -func (o *Server) HasVolumes() bool { - _, ok := o.GetVolumesOk() - return ok -} - -// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. -func (o *Server) SetVolumes(v ServerGetVolumesRetType) { - setServerGetVolumesAttributeType(&o.Volumes, v) -} - -func (o Server) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { - toSerialize["AffinityGroup"] = val - } - if val, ok := getServerGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getServerGetBootVolumeAttributeTypeOk(o.BootVolume); ok { - toSerialize["BootVolume"] = val - } - if val, ok := getServerGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getServerGetErrorMessageAttributeTypeOk(o.ErrorMessage); ok { - toSerialize["ErrorMessage"] = val - } - if val, ok := getServerGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getServerGetImageIdAttributeTypeOk(o.ImageId); ok { - toSerialize["ImageId"] = val - } - if val, ok := getServerGetKeypairNameAttributeTypeOk(o.KeypairName); ok { - toSerialize["KeypairName"] = val - } - if val, ok := getServerGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getServerGetLaunchedAtAttributeTypeOk(o.LaunchedAt); ok { - toSerialize["LaunchedAt"] = val - } - if val, ok := getServerGetMachineTypeAttributeTypeOk(o.MachineType); ok { - toSerialize["MachineType"] = val - } - if val, ok := getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { - toSerialize["MaintenanceWindow"] = val - } - if val, ok := getServerGetMetadataAttributeTypeOk(o.Metadata); ok { - toSerialize["Metadata"] = val - } - if val, ok := getServerGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getServerGetNetworkingAttributeTypeOk(o.Networking); ok { - toSerialize["Networking"] = val - } - if val, ok := getServerGetNicsAttributeTypeOk(o.Nics); ok { - toSerialize["Nics"] = val - } - if val, ok := getServerGetPowerStatusAttributeTypeOk(o.PowerStatus); ok { - toSerialize["PowerStatus"] = val - } - if val, ok := getServerGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - if val, ok := getServerGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails); ok { - toSerialize["ServiceAccountMails"] = val - } - if val, ok := getServerGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getServerGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getServerGetUserDataAttributeTypeOk(o.UserData); ok { - toSerialize["UserData"] = val - } - if val, ok := getServerGetVolumesAttributeTypeOk(o.Volumes); ok { - toSerialize["Volumes"] = val - } - return toSerialize, nil -} - -type NullableServer struct { - value *Server - isSet bool -} - -func (v NullableServer) Get() *Server { - return v.value -} - -func (v *NullableServer) Set(val *Server) { - v.value = val - v.isSet = true -} - -func (v NullableServer) IsSet() bool { - return v.isSet -} - -func (v *NullableServer) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServer(val *Server) *NullableServer { - return &NullableServer{value: val, isSet: true} -} - -func (v NullableServer) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServer) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_console_url.go b/services/iaasalpha/model_server_console_url.go deleted file mode 100644 index d75b385d8..000000000 --- a/services/iaasalpha/model_server_console_url.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServerConsoleUrl type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerConsoleUrl{} - -/* - types and functions for url -*/ - -// isNotNullableString -type ServerConsoleUrlGetUrlAttributeType = *string - -func getServerConsoleUrlGetUrlAttributeTypeOk(arg ServerConsoleUrlGetUrlAttributeType) (ret ServerConsoleUrlGetUrlRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerConsoleUrlGetUrlAttributeType(arg *ServerConsoleUrlGetUrlAttributeType, val ServerConsoleUrlGetUrlRetType) { - *arg = &val -} - -type ServerConsoleUrlGetUrlArgType = string -type ServerConsoleUrlGetUrlRetType = string - -// ServerConsoleUrl Object that represents a server console URL. -type ServerConsoleUrl struct { - // REQUIRED - Url ServerConsoleUrlGetUrlAttributeType `json:"url" required:"true"` -} - -type _ServerConsoleUrl ServerConsoleUrl - -// NewServerConsoleUrl instantiates a new ServerConsoleUrl 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 NewServerConsoleUrl(url ServerConsoleUrlGetUrlArgType) *ServerConsoleUrl { - this := ServerConsoleUrl{} - setServerConsoleUrlGetUrlAttributeType(&this.Url, url) - return &this -} - -// NewServerConsoleUrlWithDefaults instantiates a new ServerConsoleUrl 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 NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { - this := ServerConsoleUrl{} - return &this -} - -// GetUrl returns the Url field value -func (o *ServerConsoleUrl) GetUrl() (ret ServerConsoleUrlGetUrlRetType) { - ret, _ = o.GetUrlOk() - return ret -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *ServerConsoleUrl) GetUrlOk() (ret ServerConsoleUrlGetUrlRetType, ok bool) { - return getServerConsoleUrlGetUrlAttributeTypeOk(o.Url) -} - -// SetUrl sets field value -func (o *ServerConsoleUrl) SetUrl(v ServerConsoleUrlGetUrlRetType) { - setServerConsoleUrlGetUrlAttributeType(&o.Url, v) -} - -func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerConsoleUrlGetUrlAttributeTypeOk(o.Url); ok { - toSerialize["Url"] = val - } - return toSerialize, nil -} - -type NullableServerConsoleUrl struct { - value *ServerConsoleUrl - isSet bool -} - -func (v NullableServerConsoleUrl) Get() *ServerConsoleUrl { - return v.value -} - -func (v *NullableServerConsoleUrl) Set(val *ServerConsoleUrl) { - v.value = val - v.isSet = true -} - -func (v NullableServerConsoleUrl) IsSet() bool { - return v.isSet -} - -func (v *NullableServerConsoleUrl) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerConsoleUrl(val *ServerConsoleUrl) *NullableServerConsoleUrl { - return &NullableServerConsoleUrl{value: val, isSet: true} -} - -func (v NullableServerConsoleUrl) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerConsoleUrl) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_console_url_test.go b/services/iaasalpha/model_server_console_url_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_server_console_url_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_server_list_response.go b/services/iaasalpha/model_server_list_response.go deleted file mode 100644 index 9b2d9afdd..000000000 --- a/services/iaasalpha/model_server_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServerListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerListResponse{} - -/* - types and functions for items -*/ - -// isArray -type ServerListResponseGetItemsAttributeType = *[]Server -type ServerListResponseGetItemsArgType = []Server -type ServerListResponseGetItemsRetType = []Server - -func getServerListResponseGetItemsAttributeTypeOk(arg ServerListResponseGetItemsAttributeType) (ret ServerListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerListResponseGetItemsAttributeType(arg *ServerListResponseGetItemsAttributeType, val ServerListResponseGetItemsRetType) { - *arg = &val -} - -// ServerListResponse Response object for server list request. -type ServerListResponse struct { - // A list of servers. - // REQUIRED - Items ServerListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _ServerListResponse ServerListResponse - -// NewServerListResponse instantiates a new ServerListResponse 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 NewServerListResponse(items ServerListResponseGetItemsArgType) *ServerListResponse { - this := ServerListResponse{} - setServerListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewServerListResponseWithDefaults instantiates a new ServerListResponse 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 NewServerListResponseWithDefaults() *ServerListResponse { - this := ServerListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *ServerListResponse) GetItems() (ret ServerListResponseGetItemsRetType) { - 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 *ServerListResponse) GetItemsOk() (ret ServerListResponseGetItemsRetType, ok bool) { - return getServerListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *ServerListResponse) SetItems(v ServerListResponseGetItemsRetType) { - setServerListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o ServerListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableServerListResponse struct { - value *ServerListResponse - isSet bool -} - -func (v NullableServerListResponse) Get() *ServerListResponse { - return v.value -} - -func (v *NullableServerListResponse) Set(val *ServerListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableServerListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableServerListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerListResponse(val *ServerListResponse) *NullableServerListResponse { - return &NullableServerListResponse{value: val, isSet: true} -} - -func (v NullableServerListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_list_response_test.go b/services/iaasalpha/model_server_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_server_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_server_maintenance.go b/services/iaasalpha/model_server_maintenance.go deleted file mode 100644 index 638b07ac9..000000000 --- a/services/iaasalpha/model_server_maintenance.go +++ /dev/null @@ -1,263 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the ServerMaintenance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerMaintenance{} - -/* - types and functions for details -*/ - -// isNotNullableString -type ServerMaintenanceGetDetailsAttributeType = *string - -func getServerMaintenanceGetDetailsAttributeTypeOk(arg ServerMaintenanceGetDetailsAttributeType) (ret ServerMaintenanceGetDetailsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerMaintenanceGetDetailsAttributeType(arg *ServerMaintenanceGetDetailsAttributeType, val ServerMaintenanceGetDetailsRetType) { - *arg = &val -} - -type ServerMaintenanceGetDetailsArgType = string -type ServerMaintenanceGetDetailsRetType = string - -/* - types and functions for endsAt -*/ - -// isDateTime -type ServerMaintenanceGetEndsAtAttributeType = *time.Time -type ServerMaintenanceGetEndsAtArgType = time.Time -type ServerMaintenanceGetEndsAtRetType = time.Time - -func getServerMaintenanceGetEndsAtAttributeTypeOk(arg ServerMaintenanceGetEndsAtAttributeType) (ret ServerMaintenanceGetEndsAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerMaintenanceGetEndsAtAttributeType(arg *ServerMaintenanceGetEndsAtAttributeType, val ServerMaintenanceGetEndsAtRetType) { - *arg = &val -} - -/* - types and functions for startsAt -*/ - -// isDateTime -type ServerMaintenanceGetStartsAtAttributeType = *time.Time -type ServerMaintenanceGetStartsAtArgType = time.Time -type ServerMaintenanceGetStartsAtRetType = time.Time - -func getServerMaintenanceGetStartsAtAttributeTypeOk(arg ServerMaintenanceGetStartsAtAttributeType) (ret ServerMaintenanceGetStartsAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerMaintenanceGetStartsAtAttributeType(arg *ServerMaintenanceGetStartsAtAttributeType, val ServerMaintenanceGetStartsAtRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type ServerMaintenanceGetStatusAttributeType = *string - -func getServerMaintenanceGetStatusAttributeTypeOk(arg ServerMaintenanceGetStatusAttributeType) (ret ServerMaintenanceGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerMaintenanceGetStatusAttributeType(arg *ServerMaintenanceGetStatusAttributeType, val ServerMaintenanceGetStatusRetType) { - *arg = &val -} - -type ServerMaintenanceGetStatusArgType = string -type ServerMaintenanceGetStatusRetType = string - -// ServerMaintenance Object that represents the information about the next planned server maintenance window. -type ServerMaintenance struct { - Details ServerMaintenanceGetDetailsAttributeType `json:"details,omitempty"` - // End of the maintenance window. - // REQUIRED - EndsAt ServerMaintenanceGetEndsAtAttributeType `json:"endsAt" required:"true"` - // Start of the maintenance window. - // REQUIRED - StartsAt ServerMaintenanceGetStartsAtAttributeType `json:"startsAt" required:"true"` - // REQUIRED - Status ServerMaintenanceGetStatusAttributeType `json:"status" required:"true"` -} - -type _ServerMaintenance ServerMaintenance - -// NewServerMaintenance instantiates a new ServerMaintenance 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 NewServerMaintenance(endsAt ServerMaintenanceGetEndsAtArgType, startsAt ServerMaintenanceGetStartsAtArgType, status ServerMaintenanceGetStatusArgType) *ServerMaintenance { - this := ServerMaintenance{} - setServerMaintenanceGetEndsAtAttributeType(&this.EndsAt, endsAt) - setServerMaintenanceGetStartsAtAttributeType(&this.StartsAt, startsAt) - setServerMaintenanceGetStatusAttributeType(&this.Status, status) - return &this -} - -// NewServerMaintenanceWithDefaults instantiates a new ServerMaintenance 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 NewServerMaintenanceWithDefaults() *ServerMaintenance { - this := ServerMaintenance{} - return &this -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *ServerMaintenance) GetDetails() (res ServerMaintenanceGetDetailsRetType) { - res, _ = o.GetDetailsOk() - return -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetDetailsOk() (ret ServerMaintenanceGetDetailsRetType, ok bool) { - return getServerMaintenanceGetDetailsAttributeTypeOk(o.Details) -} - -// HasDetails returns a boolean if a field has been set. -func (o *ServerMaintenance) HasDetails() bool { - _, ok := o.GetDetailsOk() - return ok -} - -// SetDetails gets a reference to the given string and assigns it to the Details field. -func (o *ServerMaintenance) SetDetails(v ServerMaintenanceGetDetailsRetType) { - setServerMaintenanceGetDetailsAttributeType(&o.Details, v) -} - -// GetEndsAt returns the EndsAt field value -func (o *ServerMaintenance) GetEndsAt() (ret ServerMaintenanceGetEndsAtRetType) { - ret, _ = o.GetEndsAtOk() - return ret -} - -// GetEndsAtOk returns a tuple with the EndsAt field value -// and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetEndsAtOk() (ret ServerMaintenanceGetEndsAtRetType, ok bool) { - return getServerMaintenanceGetEndsAtAttributeTypeOk(o.EndsAt) -} - -// SetEndsAt sets field value -func (o *ServerMaintenance) SetEndsAt(v ServerMaintenanceGetEndsAtRetType) { - setServerMaintenanceGetEndsAtAttributeType(&o.EndsAt, v) -} - -// GetStartsAt returns the StartsAt field value -func (o *ServerMaintenance) GetStartsAt() (ret ServerMaintenanceGetStartsAtRetType) { - ret, _ = o.GetStartsAtOk() - return ret -} - -// GetStartsAtOk returns a tuple with the StartsAt field value -// and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetStartsAtOk() (ret ServerMaintenanceGetStartsAtRetType, ok bool) { - return getServerMaintenanceGetStartsAtAttributeTypeOk(o.StartsAt) -} - -// SetStartsAt sets field value -func (o *ServerMaintenance) SetStartsAt(v ServerMaintenanceGetStartsAtRetType) { - setServerMaintenanceGetStartsAtAttributeType(&o.StartsAt, v) -} - -// GetStatus returns the Status field value -func (o *ServerMaintenance) GetStatus() (ret ServerMaintenanceGetStatusRetType) { - ret, _ = o.GetStatusOk() - return ret -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetStatusOk() (ret ServerMaintenanceGetStatusRetType, ok bool) { - return getServerMaintenanceGetStatusAttributeTypeOk(o.Status) -} - -// SetStatus sets field value -func (o *ServerMaintenance) SetStatus(v ServerMaintenanceGetStatusRetType) { - setServerMaintenanceGetStatusAttributeType(&o.Status, v) -} - -func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerMaintenanceGetDetailsAttributeTypeOk(o.Details); ok { - toSerialize["Details"] = val - } - if val, ok := getServerMaintenanceGetEndsAtAttributeTypeOk(o.EndsAt); ok { - toSerialize["EndsAt"] = val - } - if val, ok := getServerMaintenanceGetStartsAtAttributeTypeOk(o.StartsAt); ok { - toSerialize["StartsAt"] = val - } - if val, ok := getServerMaintenanceGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - return toSerialize, nil -} - -type NullableServerMaintenance struct { - value *ServerMaintenance - isSet bool -} - -func (v NullableServerMaintenance) Get() *ServerMaintenance { - return v.value -} - -func (v *NullableServerMaintenance) Set(val *ServerMaintenance) { - v.value = val - v.isSet = true -} - -func (v NullableServerMaintenance) IsSet() bool { - return v.isSet -} - -func (v *NullableServerMaintenance) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerMaintenance(val *ServerMaintenance) *NullableServerMaintenance { - return &NullableServerMaintenance{value: val, isSet: true} -} - -func (v NullableServerMaintenance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerMaintenance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_maintenance_test.go b/services/iaasalpha/model_server_maintenance_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_server_maintenance_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_server_network.go b/services/iaasalpha/model_server_network.go deleted file mode 100644 index 83ee4338e..000000000 --- a/services/iaasalpha/model_server_network.go +++ /dev/null @@ -1,549 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServerNetwork type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerNetwork{} - -/* - types and functions for allowedAddresses -*/ - -// isArray -type ServerNetworkGetAllowedAddressesAttributeType = *[]AllowedAddressesInner -type ServerNetworkGetAllowedAddressesArgType = []AllowedAddressesInner -type ServerNetworkGetAllowedAddressesRetType = []AllowedAddressesInner - -func getServerNetworkGetAllowedAddressesAttributeTypeOk(arg ServerNetworkGetAllowedAddressesAttributeType) (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetAllowedAddressesAttributeType(arg *ServerNetworkGetAllowedAddressesAttributeType, val ServerNetworkGetAllowedAddressesRetType) { - *arg = &val -} - -/* - types and functions for ipv4 -*/ - -// isNotNullableString -type ServerNetworkGetIpv4AttributeType = *string - -func getServerNetworkGetIpv4AttributeTypeOk(arg ServerNetworkGetIpv4AttributeType) (ret ServerNetworkGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetIpv4AttributeType(arg *ServerNetworkGetIpv4AttributeType, val ServerNetworkGetIpv4RetType) { - *arg = &val -} - -type ServerNetworkGetIpv4ArgType = string -type ServerNetworkGetIpv4RetType = string - -/* - types and functions for ipv6 -*/ - -// isNotNullableString -type ServerNetworkGetIpv6AttributeType = *string - -func getServerNetworkGetIpv6AttributeTypeOk(arg ServerNetworkGetIpv6AttributeType) (ret ServerNetworkGetIpv6RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetIpv6AttributeType(arg *ServerNetworkGetIpv6AttributeType, val ServerNetworkGetIpv6RetType) { - *arg = &val -} - -type ServerNetworkGetIpv6ArgType = string -type ServerNetworkGetIpv6RetType = string - -/* - types and functions for mac -*/ - -// isNotNullableString -type ServerNetworkGetMacAttributeType = *string - -func getServerNetworkGetMacAttributeTypeOk(arg ServerNetworkGetMacAttributeType) (ret ServerNetworkGetMacRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetMacAttributeType(arg *ServerNetworkGetMacAttributeType, val ServerNetworkGetMacRetType) { - *arg = &val -} - -type ServerNetworkGetMacArgType = string -type ServerNetworkGetMacRetType = string - -/* - types and functions for networkId -*/ - -// isNotNullableString -type ServerNetworkGetNetworkIdAttributeType = *string - -func getServerNetworkGetNetworkIdAttributeTypeOk(arg ServerNetworkGetNetworkIdAttributeType) (ret ServerNetworkGetNetworkIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetNetworkIdAttributeType(arg *ServerNetworkGetNetworkIdAttributeType, val ServerNetworkGetNetworkIdRetType) { - *arg = &val -} - -type ServerNetworkGetNetworkIdArgType = string -type ServerNetworkGetNetworkIdRetType = string - -/* - types and functions for networkName -*/ - -// isNotNullableString -type ServerNetworkGetNetworkNameAttributeType = *string - -func getServerNetworkGetNetworkNameAttributeTypeOk(arg ServerNetworkGetNetworkNameAttributeType) (ret ServerNetworkGetNetworkNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetNetworkNameAttributeType(arg *ServerNetworkGetNetworkNameAttributeType, val ServerNetworkGetNetworkNameRetType) { - *arg = &val -} - -type ServerNetworkGetNetworkNameArgType = string -type ServerNetworkGetNetworkNameRetType = string - -/* - types and functions for nicId -*/ - -// isNotNullableString -type ServerNetworkGetNicIdAttributeType = *string - -func getServerNetworkGetNicIdAttributeTypeOk(arg ServerNetworkGetNicIdAttributeType) (ret ServerNetworkGetNicIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetNicIdAttributeType(arg *ServerNetworkGetNicIdAttributeType, val ServerNetworkGetNicIdRetType) { - *arg = &val -} - -type ServerNetworkGetNicIdArgType = string -type ServerNetworkGetNicIdRetType = string - -/* - types and functions for nicSecurity -*/ - -// isBoolean -type ServerNetworkgetNicSecurityAttributeType = *bool -type ServerNetworkgetNicSecurityArgType = bool -type ServerNetworkgetNicSecurityRetType = bool - -func getServerNetworkgetNicSecurityAttributeTypeOk(arg ServerNetworkgetNicSecurityAttributeType) (ret ServerNetworkgetNicSecurityRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkgetNicSecurityAttributeType(arg *ServerNetworkgetNicSecurityAttributeType, val ServerNetworkgetNicSecurityRetType) { - *arg = &val -} - -/* - types and functions for publicIp -*/ - -// isNotNullableString -type ServerNetworkGetPublicIpAttributeType = *string - -func getServerNetworkGetPublicIpAttributeTypeOk(arg ServerNetworkGetPublicIpAttributeType) (ret ServerNetworkGetPublicIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetPublicIpAttributeType(arg *ServerNetworkGetPublicIpAttributeType, val ServerNetworkGetPublicIpRetType) { - *arg = &val -} - -type ServerNetworkGetPublicIpArgType = string -type ServerNetworkGetPublicIpRetType = string - -/* - types and functions for securityGroups -*/ - -// isArray -type ServerNetworkGetSecurityGroupsAttributeType = *[]string -type ServerNetworkGetSecurityGroupsArgType = []string -type ServerNetworkGetSecurityGroupsRetType = []string - -func getServerNetworkGetSecurityGroupsAttributeTypeOk(arg ServerNetworkGetSecurityGroupsAttributeType) (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServerNetworkGetSecurityGroupsAttributeType(arg *ServerNetworkGetSecurityGroupsAttributeType, val ServerNetworkGetSecurityGroupsRetType) { - *arg = &val -} - -// ServerNetwork Describes the object that matches servers to its networks. -type ServerNetwork struct { - // A list of IPs or CIDR notations. - AllowedAddresses ServerNetworkGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` - // Object that represents an IP address. - Ipv4 ServerNetworkGetIpv4AttributeType `json:"ipv4,omitempty"` - // String that represents an IPv6 address. - Ipv6 ServerNetworkGetIpv6AttributeType `json:"ipv6,omitempty"` - // Object that represents an MAC address. - // REQUIRED - Mac ServerNetworkGetMacAttributeType `json:"mac" required:"true"` - // Universally Unique Identifier (UUID). - // REQUIRED - NetworkId ServerNetworkGetNetworkIdAttributeType `json:"networkId" required:"true"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - NetworkName ServerNetworkGetNetworkNameAttributeType `json:"networkName" required:"true"` - // Universally Unique Identifier (UUID). - // REQUIRED - NicId ServerNetworkGetNicIdAttributeType `json:"nicId" required:"true"` - // If this is set to false, then no security groups will apply to this server network interface. - // REQUIRED - NicSecurity ServerNetworkgetNicSecurityAttributeType `json:"nicSecurity" required:"true"` - // Object that represents an IP address. - PublicIp ServerNetworkGetPublicIpAttributeType `json:"publicIp,omitempty"` - // A list of UUIDs. - SecurityGroups ServerNetworkGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` -} - -type _ServerNetwork ServerNetwork - -// NewServerNetwork instantiates a new ServerNetwork 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 NewServerNetwork(mac ServerNetworkGetMacArgType, networkId ServerNetworkGetNetworkIdArgType, networkName ServerNetworkGetNetworkNameArgType, nicId ServerNetworkGetNicIdArgType, nicSecurity ServerNetworkgetNicSecurityArgType) *ServerNetwork { - this := ServerNetwork{} - setServerNetworkGetMacAttributeType(&this.Mac, mac) - setServerNetworkGetNetworkIdAttributeType(&this.NetworkId, networkId) - setServerNetworkGetNetworkNameAttributeType(&this.NetworkName, networkName) - setServerNetworkGetNicIdAttributeType(&this.NicId, nicId) - setServerNetworkgetNicSecurityAttributeType(&this.NicSecurity, nicSecurity) - return &this -} - -// NewServerNetworkWithDefaults instantiates a new ServerNetwork 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 NewServerNetworkWithDefaults() *ServerNetwork { - this := ServerNetwork{} - return &this -} - -// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *ServerNetwork) GetAllowedAddresses() (res ServerNetworkGetAllowedAddressesRetType) { - res, _ = o.GetAllowedAddressesOk() - return -} - -// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetAllowedAddressesOk() (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { - return getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) -} - -// HasAllowedAddresses returns a boolean if a field has been set. -func (o *ServerNetwork) HasAllowedAddresses() bool { - _, ok := o.GetAllowedAddressesOk() - return ok -} - -// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *ServerNetwork) SetAllowedAddresses(v ServerNetworkGetAllowedAddressesRetType) { - setServerNetworkGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *ServerNetwork) GetIpv4() (res ServerNetworkGetIpv4RetType) { - 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 *ServerNetwork) GetIpv4Ok() (ret ServerNetworkGetIpv4RetType, ok bool) { - return getServerNetworkGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *ServerNetwork) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *ServerNetwork) SetIpv4(v ServerNetworkGetIpv4RetType) { - setServerNetworkGetIpv4AttributeType(&o.Ipv4, v) -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *ServerNetwork) GetIpv6() (res ServerNetworkGetIpv6RetType) { - 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 *ServerNetwork) GetIpv6Ok() (ret ServerNetworkGetIpv6RetType, ok bool) { - return getServerNetworkGetIpv6AttributeTypeOk(o.Ipv6) -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *ServerNetwork) HasIpv6() bool { - _, ok := o.GetIpv6Ok() - return ok -} - -// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *ServerNetwork) SetIpv6(v ServerNetworkGetIpv6RetType) { - setServerNetworkGetIpv6AttributeType(&o.Ipv6, v) -} - -// GetMac returns the Mac field value -func (o *ServerNetwork) GetMac() (ret ServerNetworkGetMacRetType) { - ret, _ = o.GetMacOk() - return ret -} - -// GetMacOk returns a tuple with the Mac field value -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetMacOk() (ret ServerNetworkGetMacRetType, ok bool) { - return getServerNetworkGetMacAttributeTypeOk(o.Mac) -} - -// SetMac sets field value -func (o *ServerNetwork) SetMac(v ServerNetworkGetMacRetType) { - setServerNetworkGetMacAttributeType(&o.Mac, v) -} - -// GetNetworkId returns the NetworkId field value -func (o *ServerNetwork) GetNetworkId() (ret ServerNetworkGetNetworkIdRetType) { - 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 *ServerNetwork) GetNetworkIdOk() (ret ServerNetworkGetNetworkIdRetType, ok bool) { - return getServerNetworkGetNetworkIdAttributeTypeOk(o.NetworkId) -} - -// SetNetworkId sets field value -func (o *ServerNetwork) SetNetworkId(v ServerNetworkGetNetworkIdRetType) { - setServerNetworkGetNetworkIdAttributeType(&o.NetworkId, v) -} - -// GetNetworkName returns the NetworkName field value -func (o *ServerNetwork) GetNetworkName() (ret ServerNetworkGetNetworkNameRetType) { - ret, _ = o.GetNetworkNameOk() - return ret -} - -// GetNetworkNameOk returns a tuple with the NetworkName field value -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNetworkNameOk() (ret ServerNetworkGetNetworkNameRetType, ok bool) { - return getServerNetworkGetNetworkNameAttributeTypeOk(o.NetworkName) -} - -// SetNetworkName sets field value -func (o *ServerNetwork) SetNetworkName(v ServerNetworkGetNetworkNameRetType) { - setServerNetworkGetNetworkNameAttributeType(&o.NetworkName, v) -} - -// GetNicId returns the NicId field value -func (o *ServerNetwork) GetNicId() (ret ServerNetworkGetNicIdRetType) { - ret, _ = o.GetNicIdOk() - return ret -} - -// GetNicIdOk returns a tuple with the NicId field value -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNicIdOk() (ret ServerNetworkGetNicIdRetType, ok bool) { - return getServerNetworkGetNicIdAttributeTypeOk(o.NicId) -} - -// SetNicId sets field value -func (o *ServerNetwork) SetNicId(v ServerNetworkGetNicIdRetType) { - setServerNetworkGetNicIdAttributeType(&o.NicId, v) -} - -// GetNicSecurity returns the NicSecurity field value -func (o *ServerNetwork) GetNicSecurity() (ret ServerNetworkgetNicSecurityRetType) { - ret, _ = o.GetNicSecurityOk() - return ret -} - -// GetNicSecurityOk returns a tuple with the NicSecurity field value -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNicSecurityOk() (ret ServerNetworkgetNicSecurityRetType, ok bool) { - return getServerNetworkgetNicSecurityAttributeTypeOk(o.NicSecurity) -} - -// SetNicSecurity sets field value -func (o *ServerNetwork) SetNicSecurity(v ServerNetworkgetNicSecurityRetType) { - setServerNetworkgetNicSecurityAttributeType(&o.NicSecurity, v) -} - -// GetPublicIp returns the PublicIp field value if set, zero value otherwise. -func (o *ServerNetwork) GetPublicIp() (res ServerNetworkGetPublicIpRetType) { - 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 *ServerNetwork) GetPublicIpOk() (ret ServerNetworkGetPublicIpRetType, ok bool) { - return getServerNetworkGetPublicIpAttributeTypeOk(o.PublicIp) -} - -// HasPublicIp returns a boolean if a field has been set. -func (o *ServerNetwork) HasPublicIp() bool { - _, ok := o.GetPublicIpOk() - return ok -} - -// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. -func (o *ServerNetwork) SetPublicIp(v ServerNetworkGetPublicIpRetType) { - setServerNetworkGetPublicIpAttributeType(&o.PublicIp, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *ServerNetwork) GetSecurityGroups() (res ServerNetworkGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ServerNetwork) GetSecurityGroupsOk() (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { - return getServerNetworkGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *ServerNetwork) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *ServerNetwork) SetSecurityGroups(v ServerNetworkGetSecurityGroupsRetType) { - setServerNetworkGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -func (o ServerNetwork) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { - toSerialize["AllowedAddresses"] = val - } - if val, ok := getServerNetworkGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - if val, ok := getServerNetworkGetIpv6AttributeTypeOk(o.Ipv6); ok { - toSerialize["Ipv6"] = val - } - if val, ok := getServerNetworkGetMacAttributeTypeOk(o.Mac); ok { - toSerialize["Mac"] = val - } - if val, ok := getServerNetworkGetNetworkIdAttributeTypeOk(o.NetworkId); ok { - toSerialize["NetworkId"] = val - } - if val, ok := getServerNetworkGetNetworkNameAttributeTypeOk(o.NetworkName); ok { - toSerialize["NetworkName"] = val - } - if val, ok := getServerNetworkGetNicIdAttributeTypeOk(o.NicId); ok { - toSerialize["NicId"] = val - } - if val, ok := getServerNetworkgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { - toSerialize["NicSecurity"] = val - } - if val, ok := getServerNetworkGetPublicIpAttributeTypeOk(o.PublicIp); ok { - toSerialize["PublicIp"] = val - } - if val, ok := getServerNetworkGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - return toSerialize, nil -} - -type NullableServerNetwork struct { - value *ServerNetwork - isSet bool -} - -func (v NullableServerNetwork) Get() *ServerNetwork { - return v.value -} - -func (v *NullableServerNetwork) Set(val *ServerNetwork) { - v.value = val - v.isSet = true -} - -func (v NullableServerNetwork) IsSet() bool { - return v.isSet -} - -func (v *NullableServerNetwork) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerNetwork(val *ServerNetwork) *NullableServerNetwork { - return &NullableServerNetwork{value: val, isSet: true} -} - -func (v NullableServerNetwork) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerNetwork) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_network_test.go b/services/iaasalpha/model_server_network_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_server_network_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_server_test.go b/services/iaasalpha/model_server_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_server_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_service_account_mail_list_response.go b/services/iaasalpha/model_service_account_mail_list_response.go deleted file mode 100644 index ff1cfa9ee..000000000 --- a/services/iaasalpha/model_service_account_mail_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServiceAccountMailListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServiceAccountMailListResponse{} - -/* - types and functions for items -*/ - -// isArray -type ServiceAccountMailListResponseGetItemsAttributeType = *[]string -type ServiceAccountMailListResponseGetItemsArgType = []string -type ServiceAccountMailListResponseGetItemsRetType = []string - -func getServiceAccountMailListResponseGetItemsAttributeTypeOk(arg ServiceAccountMailListResponseGetItemsAttributeType) (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setServiceAccountMailListResponseGetItemsAttributeType(arg *ServiceAccountMailListResponseGetItemsAttributeType, val ServiceAccountMailListResponseGetItemsRetType) { - *arg = &val -} - -// ServiceAccountMailListResponse Service account mail list response. -type ServiceAccountMailListResponse struct { - // A list of service account mails. - // REQUIRED - Items ServiceAccountMailListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _ServiceAccountMailListResponse ServiceAccountMailListResponse - -// NewServiceAccountMailListResponse instantiates a new ServiceAccountMailListResponse 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 NewServiceAccountMailListResponse(items ServiceAccountMailListResponseGetItemsArgType) *ServiceAccountMailListResponse { - this := ServiceAccountMailListResponse{} - setServiceAccountMailListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewServiceAccountMailListResponseWithDefaults instantiates a new ServiceAccountMailListResponse 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 NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResponse { - this := ServiceAccountMailListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *ServiceAccountMailListResponse) GetItems() (ret ServiceAccountMailListResponseGetItemsRetType) { - 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 *ServiceAccountMailListResponse) GetItemsOk() (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { - return getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *ServiceAccountMailListResponse) SetItems(v ServiceAccountMailListResponseGetItemsRetType) { - setServiceAccountMailListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableServiceAccountMailListResponse struct { - value *ServiceAccountMailListResponse - isSet bool -} - -func (v NullableServiceAccountMailListResponse) Get() *ServiceAccountMailListResponse { - return v.value -} - -func (v *NullableServiceAccountMailListResponse) Set(val *ServiceAccountMailListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableServiceAccountMailListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableServiceAccountMailListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServiceAccountMailListResponse(val *ServiceAccountMailListResponse) *NullableServiceAccountMailListResponse { - return &NullableServiceAccountMailListResponse{value: val, isSet: true} -} - -func (v NullableServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServiceAccountMailListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_service_account_mail_list_response_test.go b/services/iaasalpha/model_service_account_mail_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_service_account_mail_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_set_image_share_payload.go b/services/iaasalpha/model_set_image_share_payload.go deleted file mode 100644 index 606fda339..000000000 --- a/services/iaasalpha/model_set_image_share_payload.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SetImageSharePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SetImageSharePayload{} - -/* - types and functions for parentOrganization -*/ - -// isBoolean -type SetImageSharePayloadgetParentOrganizationAttributeType = *bool -type SetImageSharePayloadgetParentOrganizationArgType = bool -type SetImageSharePayloadgetParentOrganizationRetType = bool - -func getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(arg SetImageSharePayloadgetParentOrganizationAttributeType) (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSetImageSharePayloadgetParentOrganizationAttributeType(arg *SetImageSharePayloadgetParentOrganizationAttributeType, val SetImageSharePayloadgetParentOrganizationRetType) { - *arg = &val -} - -/* - types and functions for projects -*/ - -// isArray -type SetImageSharePayloadGetProjectsAttributeType = *[]string -type SetImageSharePayloadGetProjectsArgType = []string -type SetImageSharePayloadGetProjectsRetType = []string - -func getSetImageSharePayloadGetProjectsAttributeTypeOk(arg SetImageSharePayloadGetProjectsAttributeType) (ret SetImageSharePayloadGetProjectsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSetImageSharePayloadGetProjectsAttributeType(arg *SetImageSharePayloadGetProjectsAttributeType, val SetImageSharePayloadGetProjectsRetType) { - *arg = &val -} - -// SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. -type SetImageSharePayload struct { - // Image is shared with all projects inside the image owners organization. - ParentOrganization SetImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` - // List of all projects the Image is shared with. - Projects SetImageSharePayloadGetProjectsAttributeType `json:"projects,omitempty"` -} - -// NewSetImageSharePayload instantiates a new SetImageSharePayload 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 NewSetImageSharePayload() *SetImageSharePayload { - this := SetImageSharePayload{} - return &this -} - -// NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload 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 NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { - this := SetImageSharePayload{} - return &this -} - -// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *SetImageSharePayload) GetParentOrganization() (res SetImageSharePayloadgetParentOrganizationRetType) { - res, _ = o.GetParentOrganizationOk() - return -} - -// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SetImageSharePayload) GetParentOrganizationOk() (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { - return getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) -} - -// HasParentOrganization returns a boolean if a field has been set. -func (o *SetImageSharePayload) HasParentOrganization() bool { - _, ok := o.GetParentOrganizationOk() - return ok -} - -// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *SetImageSharePayload) SetParentOrganization(v SetImageSharePayloadgetParentOrganizationRetType) { - setSetImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) -} - -// GetProjects returns the Projects field value if set, zero value otherwise. -func (o *SetImageSharePayload) GetProjects() (res SetImageSharePayloadGetProjectsRetType) { - res, _ = o.GetProjectsOk() - return -} - -// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SetImageSharePayload) GetProjectsOk() (ret SetImageSharePayloadGetProjectsRetType, ok bool) { - return getSetImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) -} - -// HasProjects returns a boolean if a field has been set. -func (o *SetImageSharePayload) HasProjects() bool { - _, ok := o.GetProjectsOk() - return ok -} - -// SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *SetImageSharePayload) SetProjects(v SetImageSharePayloadGetProjectsRetType) { - setSetImageSharePayloadGetProjectsAttributeType(&o.Projects, v) -} - -func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { - toSerialize["ParentOrganization"] = val - } - if val, ok := getSetImageSharePayloadGetProjectsAttributeTypeOk(o.Projects); ok { - toSerialize["Projects"] = val - } - return toSerialize, nil -} - -type NullableSetImageSharePayload struct { - value *SetImageSharePayload - isSet bool -} - -func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { - return v.value -} - -func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { - v.value = val - v.isSet = true -} - -func (v NullableSetImageSharePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableSetImageSharePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { - return &NullableSetImageSharePayload{value: val, isSet: true} -} - -func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_set_image_share_payload_test.go b/services/iaasalpha/model_set_image_share_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_set_image_share_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_snapshot.go b/services/iaasalpha/model_snapshot.go deleted file mode 100644 index 17004a803..000000000 --- a/services/iaasalpha/model_snapshot.go +++ /dev/null @@ -1,467 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Snapshot type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Snapshot{} - -/* - types and functions for createdAt -*/ - -// isDateTime -type SnapshotGetCreatedAtAttributeType = *time.Time -type SnapshotGetCreatedAtArgType = time.Time -type SnapshotGetCreatedAtRetType = time.Time - -func getSnapshotGetCreatedAtAttributeTypeOk(arg SnapshotGetCreatedAtAttributeType) (ret SnapshotGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetCreatedAtAttributeType(arg *SnapshotGetCreatedAtAttributeType, val SnapshotGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type SnapshotGetIdAttributeType = *string - -func getSnapshotGetIdAttributeTypeOk(arg SnapshotGetIdAttributeType) (ret SnapshotGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetIdAttributeType(arg *SnapshotGetIdAttributeType, val SnapshotGetIdRetType) { - *arg = &val -} - -type SnapshotGetIdArgType = string -type SnapshotGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type SnapshotGetLabelsAttributeType = *map[string]interface{} -type SnapshotGetLabelsArgType = map[string]interface{} -type SnapshotGetLabelsRetType = map[string]interface{} - -func getSnapshotGetLabelsAttributeTypeOk(arg SnapshotGetLabelsAttributeType) (ret SnapshotGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetLabelsAttributeType(arg *SnapshotGetLabelsAttributeType, val SnapshotGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type SnapshotGetNameAttributeType = *string - -func getSnapshotGetNameAttributeTypeOk(arg SnapshotGetNameAttributeType) (ret SnapshotGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetNameAttributeType(arg *SnapshotGetNameAttributeType, val SnapshotGetNameRetType) { - *arg = &val -} - -type SnapshotGetNameArgType = string -type SnapshotGetNameRetType = string - -/* - types and functions for size -*/ - -// isLong -type SnapshotGetSizeAttributeType = *int64 -type SnapshotGetSizeArgType = int64 -type SnapshotGetSizeRetType = int64 - -func getSnapshotGetSizeAttributeTypeOk(arg SnapshotGetSizeAttributeType) (ret SnapshotGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetSizeAttributeType(arg *SnapshotGetSizeAttributeType, val SnapshotGetSizeRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type SnapshotGetStatusAttributeType = *string - -func getSnapshotGetStatusAttributeTypeOk(arg SnapshotGetStatusAttributeType) (ret SnapshotGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetStatusAttributeType(arg *SnapshotGetStatusAttributeType, val SnapshotGetStatusRetType) { - *arg = &val -} - -type SnapshotGetStatusArgType = string -type SnapshotGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type SnapshotGetUpdatedAtAttributeType = *time.Time -type SnapshotGetUpdatedAtArgType = time.Time -type SnapshotGetUpdatedAtRetType = time.Time - -func getSnapshotGetUpdatedAtAttributeTypeOk(arg SnapshotGetUpdatedAtAttributeType) (ret SnapshotGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetUpdatedAtAttributeType(arg *SnapshotGetUpdatedAtAttributeType, val SnapshotGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type SnapshotGetVolumeIdAttributeType = *string - -func getSnapshotGetVolumeIdAttributeTypeOk(arg SnapshotGetVolumeIdAttributeType) (ret SnapshotGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotGetVolumeIdAttributeType(arg *SnapshotGetVolumeIdAttributeType, val SnapshotGetVolumeIdRetType) { - *arg = &val -} - -type SnapshotGetVolumeIdArgType = string -type SnapshotGetVolumeIdRetType = string - -// Snapshot Object that represents a snapshot. -type Snapshot struct { - // Date-time when resource was created. - CreatedAt SnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - Id SnapshotGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels SnapshotGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name SnapshotGetNameAttributeType `json:"name,omitempty"` - // Size in Gigabyte. - Size SnapshotGetSizeAttributeType `json:"size,omitempty"` - // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. - Status SnapshotGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt SnapshotGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // Universally Unique Identifier (UUID). - // REQUIRED - VolumeId SnapshotGetVolumeIdAttributeType `json:"volumeId" required:"true"` -} - -type _Snapshot Snapshot - -// NewSnapshot instantiates a new Snapshot 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 NewSnapshot(volumeId SnapshotGetVolumeIdArgType) *Snapshot { - this := Snapshot{} - setSnapshotGetVolumeIdAttributeType(&this.VolumeId, volumeId) - return &this -} - -// NewSnapshotWithDefaults instantiates a new Snapshot 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 NewSnapshotWithDefaults() *Snapshot { - this := Snapshot{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Snapshot) GetCreatedAt() (res SnapshotGetCreatedAtRetType) { - 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 *Snapshot) GetCreatedAtOk() (ret SnapshotGetCreatedAtRetType, ok bool) { - return getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Snapshot) 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 *Snapshot) SetCreatedAt(v SnapshotGetCreatedAtRetType) { - setSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Snapshot) GetId() (res SnapshotGetIdRetType) { - 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 *Snapshot) GetIdOk() (ret SnapshotGetIdRetType, ok bool) { - return getSnapshotGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *Snapshot) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Snapshot) SetId(v SnapshotGetIdRetType) { - setSnapshotGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Snapshot) GetLabels() (res SnapshotGetLabelsRetType) { - 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 *Snapshot) GetLabelsOk() (ret SnapshotGetLabelsRetType, ok bool) { - return getSnapshotGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Snapshot) 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 *Snapshot) SetLabels(v SnapshotGetLabelsRetType) { - setSnapshotGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Snapshot) GetName() (res SnapshotGetNameRetType) { - 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 *Snapshot) GetNameOk() (ret SnapshotGetNameRetType, ok bool) { - return getSnapshotGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *Snapshot) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Snapshot) SetName(v SnapshotGetNameRetType) { - setSnapshotGetNameAttributeType(&o.Name, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *Snapshot) GetSize() (res SnapshotGetSizeRetType) { - 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 *Snapshot) GetSizeOk() (ret SnapshotGetSizeRetType, ok bool) { - return getSnapshotGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *Snapshot) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Snapshot) SetSize(v SnapshotGetSizeRetType) { - setSnapshotGetSizeAttributeType(&o.Size, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Snapshot) GetStatus() (res SnapshotGetStatusRetType) { - 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 *Snapshot) GetStatusOk() (ret SnapshotGetStatusRetType, ok bool) { - return getSnapshotGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *Snapshot) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Snapshot) SetStatus(v SnapshotGetStatusRetType) { - setSnapshotGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Snapshot) GetUpdatedAt() (res SnapshotGetUpdatedAtRetType) { - 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 *Snapshot) GetUpdatedAtOk() (ret SnapshotGetUpdatedAtRetType, ok bool) { - return getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Snapshot) 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 *Snapshot) SetUpdatedAt(v SnapshotGetUpdatedAtRetType) { - setSnapshotGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetVolumeId returns the VolumeId field value -func (o *Snapshot) GetVolumeId() (ret SnapshotGetVolumeIdRetType) { - ret, _ = o.GetVolumeIdOk() - return ret -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value -// and a boolean to check if the value has been set. -func (o *Snapshot) GetVolumeIdOk() (ret SnapshotGetVolumeIdRetType, ok bool) { - return getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// SetVolumeId sets field value -func (o *Snapshot) SetVolumeId(v SnapshotGetVolumeIdRetType) { - setSnapshotGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o Snapshot) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getSnapshotGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getSnapshotGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getSnapshotGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getSnapshotGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getSnapshotGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableSnapshot struct { - value *Snapshot - isSet bool -} - -func (v NullableSnapshot) Get() *Snapshot { - return v.value -} - -func (v *NullableSnapshot) Set(val *Snapshot) { - v.value = val - v.isSet = true -} - -func (v NullableSnapshot) IsSet() bool { - return v.isSet -} - -func (v *NullableSnapshot) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { - return &NullableSnapshot{value: val, isSet: true} -} - -func (v NullableSnapshot) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_snapshot_list_response.go b/services/iaasalpha/model_snapshot_list_response.go deleted file mode 100644 index b2963e14c..000000000 --- a/services/iaasalpha/model_snapshot_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the SnapshotListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SnapshotListResponse{} - -/* - types and functions for items -*/ - -// isArray -type SnapshotListResponseGetItemsAttributeType = *[]Snapshot -type SnapshotListResponseGetItemsArgType = []Snapshot -type SnapshotListResponseGetItemsRetType = []Snapshot - -func getSnapshotListResponseGetItemsAttributeTypeOk(arg SnapshotListResponseGetItemsAttributeType) (ret SnapshotListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setSnapshotListResponseGetItemsAttributeType(arg *SnapshotListResponseGetItemsAttributeType, val SnapshotListResponseGetItemsRetType) { - *arg = &val -} - -// SnapshotListResponse Snapshot list response. -type SnapshotListResponse struct { - // A list containing snapshot objects. - // REQUIRED - Items SnapshotListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _SnapshotListResponse SnapshotListResponse - -// NewSnapshotListResponse instantiates a new SnapshotListResponse 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 NewSnapshotListResponse(items SnapshotListResponseGetItemsArgType) *SnapshotListResponse { - this := SnapshotListResponse{} - setSnapshotListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse 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 NewSnapshotListResponseWithDefaults() *SnapshotListResponse { - this := SnapshotListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *SnapshotListResponse) GetItems() (ret SnapshotListResponseGetItemsRetType) { - 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 *SnapshotListResponse) GetItemsOk() (ret SnapshotListResponseGetItemsRetType, ok bool) { - return getSnapshotListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *SnapshotListResponse) SetItems(v SnapshotListResponseGetItemsRetType) { - setSnapshotListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getSnapshotListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableSnapshotListResponse struct { - value *SnapshotListResponse - isSet bool -} - -func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { - return v.value -} - -func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableSnapshotListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableSnapshotListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { - return &NullableSnapshotListResponse{value: val, isSet: true} -} - -func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_snapshot_list_response_test.go b/services/iaasalpha/model_snapshot_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_snapshot_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_snapshot_test.go b/services/iaasalpha/model_snapshot_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_snapshot_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_static_area_id.go b/services/iaasalpha/model_static_area_id.go deleted file mode 100644 index 31592f83d..000000000 --- a/services/iaasalpha/model_static_area_id.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "fmt" -) - -// StaticAreaID The identifier (ID) of a static area. -type StaticAreaID string - -// List of StaticAreaID -const ( - STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" - STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ" -) - -// All allowed values of StaticAreaID enum -var AllowedStaticAreaIDEnumValues = []StaticAreaID{ - "PUBLIC", - "SCHWARZ", -} - -func (v *StaticAreaID) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue string - if value == zeroValue { - return nil - } - enumTypeValue := StaticAreaID(value) - for _, existing := range AllowedStaticAreaIDEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid StaticAreaID", value) -} - -// NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { - ev := StaticAreaID(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for StaticAreaID: valid values are %v", v, AllowedStaticAreaIDEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v StaticAreaID) IsValid() bool { - for _, existing := range AllowedStaticAreaIDEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to StaticAreaID value -func (v StaticAreaID) Ptr() *StaticAreaID { - return &v -} - -type NullableStaticAreaID struct { - value *StaticAreaID - isSet bool -} - -func (v NullableStaticAreaID) Get() *StaticAreaID { - return v.value -} - -func (v *NullableStaticAreaID) Set(val *StaticAreaID) { - v.value = val - v.isSet = true -} - -func (v NullableStaticAreaID) IsSet() bool { - return v.isSet -} - -func (v *NullableStaticAreaID) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID { - return &NullableStaticAreaID{value: val, isSet: true} -} - -func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_static_area_id_test.go b/services/iaasalpha/model_static_area_id_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_static_area_id_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_area_address_family.go b/services/iaasalpha/model_update_area_address_family.go deleted file mode 100644 index 1d8b0d925..000000000 --- a/services/iaasalpha/model_update_area_address_family.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateAreaAddressFamily type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateAreaAddressFamily{} - -/* - types and functions for ipv4 -*/ - -// isModel -type UpdateAreaAddressFamilyGetIpv4AttributeType = *UpdateAreaIPv4 -type UpdateAreaAddressFamilyGetIpv4ArgType = UpdateAreaIPv4 -type UpdateAreaAddressFamilyGetIpv4RetType = UpdateAreaIPv4 - -func getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(arg UpdateAreaAddressFamilyGetIpv4AttributeType) (ret UpdateAreaAddressFamilyGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAreaAddressFamilyGetIpv4AttributeType(arg *UpdateAreaAddressFamilyGetIpv4AttributeType, val UpdateAreaAddressFamilyGetIpv4RetType) { - *arg = &val -} - -// UpdateAreaAddressFamily The addressFamily object for a area update request. -type UpdateAreaAddressFamily struct { - Ipv4 UpdateAreaAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` -} - -// NewUpdateAreaAddressFamily instantiates a new UpdateAreaAddressFamily 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 NewUpdateAreaAddressFamily() *UpdateAreaAddressFamily { - this := UpdateAreaAddressFamily{} - return &this -} - -// NewUpdateAreaAddressFamilyWithDefaults instantiates a new UpdateAreaAddressFamily 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 NewUpdateAreaAddressFamilyWithDefaults() *UpdateAreaAddressFamily { - this := UpdateAreaAddressFamily{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *UpdateAreaAddressFamily) GetIpv4() (res UpdateAreaAddressFamilyGetIpv4RetType) { - 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 *UpdateAreaAddressFamily) GetIpv4Ok() (ret UpdateAreaAddressFamilyGetIpv4RetType, ok bool) { - return getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *UpdateAreaAddressFamily) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given UpdateAreaIPv4 and assigns it to the Ipv4 field. -func (o *UpdateAreaAddressFamily) SetIpv4(v UpdateAreaAddressFamilyGetIpv4RetType) { - setUpdateAreaAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) -} - -func (o UpdateAreaAddressFamily) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - return toSerialize, nil -} - -type NullableUpdateAreaAddressFamily struct { - value *UpdateAreaAddressFamily - isSet bool -} - -func (v NullableUpdateAreaAddressFamily) Get() *UpdateAreaAddressFamily { - return v.value -} - -func (v *NullableUpdateAreaAddressFamily) Set(val *UpdateAreaAddressFamily) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateAreaAddressFamily) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateAreaAddressFamily) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateAreaAddressFamily(val *UpdateAreaAddressFamily) *NullableUpdateAreaAddressFamily { - return &NullableUpdateAreaAddressFamily{value: val, isSet: true} -} - -func (v NullableUpdateAreaAddressFamily) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateAreaAddressFamily) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_area_address_family_test.go b/services/iaasalpha/model_update_area_address_family_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_area_address_family_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_area_ipv4.go b/services/iaasalpha/model_update_area_ipv4.go deleted file mode 100644 index bc08600cb..000000000 --- a/services/iaasalpha/model_update_area_ipv4.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateAreaIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateAreaIPv4{} - -/* - types and functions for defaultNameservers -*/ - -// isArray -type UpdateAreaIPv4GetDefaultNameserversAttributeType = *[]string -type UpdateAreaIPv4GetDefaultNameserversArgType = []string -type UpdateAreaIPv4GetDefaultNameserversRetType = []string - -func getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(arg UpdateAreaIPv4GetDefaultNameserversAttributeType) (ret UpdateAreaIPv4GetDefaultNameserversRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAreaIPv4GetDefaultNameserversAttributeType(arg *UpdateAreaIPv4GetDefaultNameserversAttributeType, val UpdateAreaIPv4GetDefaultNameserversRetType) { - *arg = &val -} - -/* - types and functions for defaultPrefixLen -*/ - -// isInteger -type UpdateAreaIPv4GetDefaultPrefixLenAttributeType = *int64 -type UpdateAreaIPv4GetDefaultPrefixLenArgType = int64 -type UpdateAreaIPv4GetDefaultPrefixLenRetType = int64 - -func getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetDefaultPrefixLenAttributeType) (ret UpdateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAreaIPv4GetDefaultPrefixLenAttributeType(arg *UpdateAreaIPv4GetDefaultPrefixLenAttributeType, val UpdateAreaIPv4GetDefaultPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for maxPrefixLen -*/ - -// isInteger -type UpdateAreaIPv4GetMaxPrefixLenAttributeType = *int64 -type UpdateAreaIPv4GetMaxPrefixLenArgType = int64 -type UpdateAreaIPv4GetMaxPrefixLenRetType = int64 - -func getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetMaxPrefixLenAttributeType) (ret UpdateAreaIPv4GetMaxPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAreaIPv4GetMaxPrefixLenAttributeType(arg *UpdateAreaIPv4GetMaxPrefixLenAttributeType, val UpdateAreaIPv4GetMaxPrefixLenRetType) { - *arg = &val -} - -/* - types and functions for minPrefixLen -*/ - -// isInteger -type UpdateAreaIPv4GetMinPrefixLenAttributeType = *int64 -type UpdateAreaIPv4GetMinPrefixLenArgType = int64 -type UpdateAreaIPv4GetMinPrefixLenRetType = int64 - -func getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetMinPrefixLenAttributeType) (ret UpdateAreaIPv4GetMinPrefixLenRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAreaIPv4GetMinPrefixLenAttributeType(arg *UpdateAreaIPv4GetMinPrefixLenAttributeType, val UpdateAreaIPv4GetMinPrefixLenRetType) { - *arg = &val -} - -// UpdateAreaIPv4 The update object for a IPv4 network area. -type UpdateAreaIPv4 struct { - DefaultNameservers UpdateAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` - // The default prefix length for networks in the network area. - DefaultPrefixLen UpdateAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` - // The maximal prefix length for networks in the network area. - MaxPrefixLen UpdateAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for networks in the network area. - MinPrefixLen UpdateAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` -} - -// NewUpdateAreaIPv4 instantiates a new UpdateAreaIPv4 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 NewUpdateAreaIPv4() *UpdateAreaIPv4 { - this := UpdateAreaIPv4{} - return &this -} - -// NewUpdateAreaIPv4WithDefaults instantiates a new UpdateAreaIPv4 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 NewUpdateAreaIPv4WithDefaults() *UpdateAreaIPv4 { - this := UpdateAreaIPv4{} - return &this -} - -// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetDefaultNameservers() (res UpdateAreaIPv4GetDefaultNameserversRetType) { - 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 *UpdateAreaIPv4) GetDefaultNameserversOk() (ret UpdateAreaIPv4GetDefaultNameserversRetType, ok bool) { - return getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) -} - -// HasDefaultNameservers returns a boolean if a field has been set. -func (o *UpdateAreaIPv4) HasDefaultNameservers() bool { - _, ok := o.GetDefaultNameserversOk() - return ok -} - -// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *UpdateAreaIPv4) SetDefaultNameservers(v UpdateAreaIPv4GetDefaultNameserversRetType) { - setUpdateAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetDefaultPrefixLen() (res UpdateAreaIPv4GetDefaultPrefixLenRetType) { - 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 *UpdateAreaIPv4) GetDefaultPrefixLenOk() (ret UpdateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { - return getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *UpdateAreaIPv4) HasDefaultPrefixLen() bool { - _, ok := o.GetDefaultPrefixLenOk() - return ok -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *UpdateAreaIPv4) SetDefaultPrefixLen(v UpdateAreaIPv4GetDefaultPrefixLenRetType) { - setUpdateAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetMaxPrefixLen() (res UpdateAreaIPv4GetMaxPrefixLenRetType) { - 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 *UpdateAreaIPv4) GetMaxPrefixLenOk() (ret UpdateAreaIPv4GetMaxPrefixLenRetType, ok bool) { - return getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *UpdateAreaIPv4) HasMaxPrefixLen() bool { - _, ok := o.GetMaxPrefixLenOk() - return ok -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *UpdateAreaIPv4) SetMaxPrefixLen(v UpdateAreaIPv4GetMaxPrefixLenRetType) { - setUpdateAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetMinPrefixLen() (res UpdateAreaIPv4GetMinPrefixLenRetType) { - 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 *UpdateAreaIPv4) GetMinPrefixLenOk() (ret UpdateAreaIPv4GetMinPrefixLenRetType, ok bool) { - return getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *UpdateAreaIPv4) HasMinPrefixLen() bool { - _, ok := o.GetMinPrefixLenOk() - return ok -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *UpdateAreaIPv4) SetMinPrefixLen(v UpdateAreaIPv4GetMinPrefixLenRetType) { - setUpdateAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) -} - -func (o UpdateAreaIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { - toSerialize["DefaultNameservers"] = val - } - if val, ok := getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { - toSerialize["DefaultPrefixLen"] = val - } - if val, ok := getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { - toSerialize["MaxPrefixLen"] = val - } - if val, ok := getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { - toSerialize["MinPrefixLen"] = val - } - return toSerialize, nil -} - -type NullableUpdateAreaIPv4 struct { - value *UpdateAreaIPv4 - isSet bool -} - -func (v NullableUpdateAreaIPv4) Get() *UpdateAreaIPv4 { - return v.value -} - -func (v *NullableUpdateAreaIPv4) Set(val *UpdateAreaIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateAreaIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateAreaIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateAreaIPv4(val *UpdateAreaIPv4) *NullableUpdateAreaIPv4 { - return &NullableUpdateAreaIPv4{value: val, isSet: true} -} - -func (v NullableUpdateAreaIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateAreaIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_area_ipv4_test.go b/services/iaasalpha/model_update_area_ipv4_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_area_ipv4_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_attached_volume_payload.go b/services/iaasalpha/model_update_attached_volume_payload.go deleted file mode 100644 index a4ec7cb9e..000000000 --- a/services/iaasalpha/model_update_attached_volume_payload.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateAttachedVolumePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateAttachedVolumePayload{} - -/* - types and functions for deleteOnTermination -*/ - -// isBoolean -type UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType = *bool -type UpdateAttachedVolumePayloadgetDeleteOnTerminationArgType = bool -type UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType = bool - -func getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(arg UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType) (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(arg *UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType, val UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { - *arg = &val -} - -/* - types and functions for serverId -*/ - -// isNotNullableString -type UpdateAttachedVolumePayloadGetServerIdAttributeType = *string - -func getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetServerIdAttributeType) (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAttachedVolumePayloadGetServerIdAttributeType(arg *UpdateAttachedVolumePayloadGetServerIdAttributeType, val UpdateAttachedVolumePayloadGetServerIdRetType) { - *arg = &val -} - -type UpdateAttachedVolumePayloadGetServerIdArgType = string -type UpdateAttachedVolumePayloadGetServerIdRetType = string - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type UpdateAttachedVolumePayloadGetVolumeIdAttributeType = *string - -func getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetVolumeIdAttributeType) (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(arg *UpdateAttachedVolumePayloadGetVolumeIdAttributeType, val UpdateAttachedVolumePayloadGetVolumeIdRetType) { - *arg = &val -} - -type UpdateAttachedVolumePayloadGetVolumeIdArgType = string -type UpdateAttachedVolumePayloadGetVolumeIdRetType = string - -// UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. -type UpdateAttachedVolumePayload struct { - // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` - // Universally Unique Identifier (UUID). - ServerId UpdateAttachedVolumePayloadGetServerIdAttributeType `json:"serverId,omitempty"` - // Universally Unique Identifier (UUID). - VolumeId UpdateAttachedVolumePayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` -} - -// NewUpdateAttachedVolumePayload instantiates a new UpdateAttachedVolumePayload 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 NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { - this := UpdateAttachedVolumePayload{} - return &this -} - -// NewUpdateAttachedVolumePayloadWithDefaults instantiates a new UpdateAttachedVolumePayload 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 NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { - this := UpdateAttachedVolumePayload{} - return &this -} - -// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() (res UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { - 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 *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { - return getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) -} - -// HasDeleteOnTermination returns a boolean if a field has been set. -func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { - _, ok := o.GetDeleteOnTerminationOk() - return ok -} - -// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { - setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) -} - -// GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetServerId() (res UpdateAttachedVolumePayloadGetServerIdRetType) { - res, _ = o.GetServerIdOk() - return -} - -// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAttachedVolumePayload) GetServerIdOk() (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { - return getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) -} - -// HasServerId returns a boolean if a field has been set. -func (o *UpdateAttachedVolumePayload) HasServerId() bool { - _, ok := o.GetServerIdOk() - return ok -} - -// SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *UpdateAttachedVolumePayload) SetServerId(v UpdateAttachedVolumePayloadGetServerIdRetType) { - setUpdateAttachedVolumePayloadGetServerIdAttributeType(&o.ServerId, v) -} - -// GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetVolumeId() (res UpdateAttachedVolumePayloadGetVolumeIdRetType) { - res, _ = o.GetVolumeIdOk() - return -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { - return getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// HasVolumeId returns a boolean if a field has been set. -func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { - _, ok := o.GetVolumeIdOk() - return ok -} - -// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *UpdateAttachedVolumePayload) SetVolumeId(v UpdateAttachedVolumePayloadGetVolumeIdRetType) { - setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { - toSerialize["DeleteOnTermination"] = val - } - if val, ok := getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(o.ServerId); ok { - toSerialize["ServerId"] = val - } - if val, ok := getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableUpdateAttachedVolumePayload struct { - value *UpdateAttachedVolumePayload - isSet bool -} - -func (v NullableUpdateAttachedVolumePayload) Get() *UpdateAttachedVolumePayload { - return v.value -} - -func (v *NullableUpdateAttachedVolumePayload) Set(val *UpdateAttachedVolumePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateAttachedVolumePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateAttachedVolumePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateAttachedVolumePayload(val *UpdateAttachedVolumePayload) *NullableUpdateAttachedVolumePayload { - return &NullableUpdateAttachedVolumePayload{value: val, isSet: true} -} - -func (v NullableUpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateAttachedVolumePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_attached_volume_payload_test.go b/services/iaasalpha/model_update_attached_volume_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_attached_volume_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_backup_payload.go b/services/iaasalpha/model_update_backup_payload.go deleted file mode 100644 index 64de0920f..000000000 --- a/services/iaasalpha/model_update_backup_payload.go +++ /dev/null @@ -1,567 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the UpdateBackupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateBackupPayload{} - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type UpdateBackupPayloadGetAvailabilityZoneAttributeType = *string - -func getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(arg UpdateBackupPayloadGetAvailabilityZoneAttributeType) (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetAvailabilityZoneAttributeType(arg *UpdateBackupPayloadGetAvailabilityZoneAttributeType, val UpdateBackupPayloadGetAvailabilityZoneRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetAvailabilityZoneArgType = string -type UpdateBackupPayloadGetAvailabilityZoneRetType = string - -/* - types and functions for createdAt -*/ - -// isDateTime -type UpdateBackupPayloadGetCreatedAtAttributeType = *time.Time -type UpdateBackupPayloadGetCreatedAtArgType = time.Time -type UpdateBackupPayloadGetCreatedAtRetType = time.Time - -func getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(arg UpdateBackupPayloadGetCreatedAtAttributeType) (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetCreatedAtAttributeType(arg *UpdateBackupPayloadGetCreatedAtAttributeType, val UpdateBackupPayloadGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -type UpdateBackupPayloadGetIdAttributeType = *string - -func getUpdateBackupPayloadGetIdAttributeTypeOk(arg UpdateBackupPayloadGetIdAttributeType) (ret UpdateBackupPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetIdAttributeType(arg *UpdateBackupPayloadGetIdAttributeType, val UpdateBackupPayloadGetIdRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetIdArgType = string -type UpdateBackupPayloadGetIdRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateBackupPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateBackupPayloadGetLabelsArgType = map[string]interface{} -type UpdateBackupPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateBackupPayloadGetLabelsAttributeTypeOk(arg UpdateBackupPayloadGetLabelsAttributeType) (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetLabelsAttributeType(arg *UpdateBackupPayloadGetLabelsAttributeType, val UpdateBackupPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateBackupPayloadGetNameAttributeType = *string - -func getUpdateBackupPayloadGetNameAttributeTypeOk(arg UpdateBackupPayloadGetNameAttributeType) (ret UpdateBackupPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetNameAttributeType(arg *UpdateBackupPayloadGetNameAttributeType, val UpdateBackupPayloadGetNameRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetNameArgType = string -type UpdateBackupPayloadGetNameRetType = string - -/* - types and functions for size -*/ - -// isLong -type UpdateBackupPayloadGetSizeAttributeType = *int64 -type UpdateBackupPayloadGetSizeArgType = int64 -type UpdateBackupPayloadGetSizeRetType = int64 - -func getUpdateBackupPayloadGetSizeAttributeTypeOk(arg UpdateBackupPayloadGetSizeAttributeType) (ret UpdateBackupPayloadGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetSizeAttributeType(arg *UpdateBackupPayloadGetSizeAttributeType, val UpdateBackupPayloadGetSizeRetType) { - *arg = &val -} - -/* - types and functions for snapshotId -*/ - -// isNotNullableString -type UpdateBackupPayloadGetSnapshotIdAttributeType = *string - -func getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(arg UpdateBackupPayloadGetSnapshotIdAttributeType) (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetSnapshotIdAttributeType(arg *UpdateBackupPayloadGetSnapshotIdAttributeType, val UpdateBackupPayloadGetSnapshotIdRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetSnapshotIdArgType = string -type UpdateBackupPayloadGetSnapshotIdRetType = string - -/* - types and functions for status -*/ - -// isNotNullableString -type UpdateBackupPayloadGetStatusAttributeType = *string - -func getUpdateBackupPayloadGetStatusAttributeTypeOk(arg UpdateBackupPayloadGetStatusAttributeType) (ret UpdateBackupPayloadGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetStatusAttributeType(arg *UpdateBackupPayloadGetStatusAttributeType, val UpdateBackupPayloadGetStatusRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetStatusArgType = string -type UpdateBackupPayloadGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type UpdateBackupPayloadGetUpdatedAtAttributeType = *time.Time -type UpdateBackupPayloadGetUpdatedAtArgType = time.Time -type UpdateBackupPayloadGetUpdatedAtRetType = time.Time - -func getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(arg UpdateBackupPayloadGetUpdatedAtAttributeType) (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetUpdatedAtAttributeType(arg *UpdateBackupPayloadGetUpdatedAtAttributeType, val UpdateBackupPayloadGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type UpdateBackupPayloadGetVolumeIdAttributeType = *string - -func getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(arg UpdateBackupPayloadGetVolumeIdAttributeType) (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateBackupPayloadGetVolumeIdAttributeType(arg *UpdateBackupPayloadGetVolumeIdAttributeType, val UpdateBackupPayloadGetVolumeIdRetType) { - *arg = &val -} - -type UpdateBackupPayloadGetVolumeIdArgType = string -type UpdateBackupPayloadGetVolumeIdRetType = string - -// UpdateBackupPayload Object that represents a backup. -type UpdateBackupPayload struct { - // Object that represents an availability zone. - AvailabilityZone UpdateBackupPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` - // Date-time when resource was created. - CreatedAt UpdateBackupPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Universally Unique Identifier (UUID). - Id UpdateBackupPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateBackupPayloadGetNameAttributeType `json:"name,omitempty"` - // Size in Gigabyte. - Size UpdateBackupPayloadGetSizeAttributeType `json:"size,omitempty"` - // Universally Unique Identifier (UUID). - SnapshotId UpdateBackupPayloadGetSnapshotIdAttributeType `json:"snapshotId,omitempty"` - // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. - Status UpdateBackupPayloadGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt UpdateBackupPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // Universally Unique Identifier (UUID). - VolumeId UpdateBackupPayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` -} - -// NewUpdateBackupPayload instantiates a new UpdateBackupPayload 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 NewUpdateBackupPayload() *UpdateBackupPayload { - this := UpdateBackupPayload{} - return &this -} - -// NewUpdateBackupPayloadWithDefaults instantiates a new UpdateBackupPayload 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 NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { - this := UpdateBackupPayload{} - return &this -} - -// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetAvailabilityZone() (res UpdateBackupPayloadGetAvailabilityZoneRetType) { - res, _ = o.GetAvailabilityZoneOk() - return -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { - return getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// HasAvailabilityZone returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasAvailabilityZone() bool { - _, ok := o.GetAvailabilityZoneOk() - return ok -} - -// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *UpdateBackupPayload) SetAvailabilityZone(v UpdateBackupPayloadGetAvailabilityZoneRetType) { - setUpdateBackupPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetCreatedAt() (res UpdateBackupPayloadGetCreatedAtRetType) { - 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 *UpdateBackupPayload) GetCreatedAtOk() (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { - return getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetCreatedAt(v UpdateBackupPayloadGetCreatedAtRetType) { - setUpdateBackupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetId() (res UpdateBackupPayloadGetIdRetType) { - 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 *UpdateBackupPayload) GetIdOk() (ret UpdateBackupPayloadGetIdRetType, ok bool) { - return getUpdateBackupPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *UpdateBackupPayload) SetId(v UpdateBackupPayloadGetIdRetType) { - setUpdateBackupPayloadGetIdAttributeType(&o.Id, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetLabels() (res UpdateBackupPayloadGetLabelsRetType) { - 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 *UpdateBackupPayload) GetLabelsOk() (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { - return getUpdateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetLabels(v UpdateBackupPayloadGetLabelsRetType) { - setUpdateBackupPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetName() (res UpdateBackupPayloadGetNameRetType) { - 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 *UpdateBackupPayload) GetNameOk() (ret UpdateBackupPayloadGetNameRetType, ok bool) { - return getUpdateBackupPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateBackupPayload) SetName(v UpdateBackupPayloadGetNameRetType) { - setUpdateBackupPayloadGetNameAttributeType(&o.Name, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetSize() (res UpdateBackupPayloadGetSizeRetType) { - 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 *UpdateBackupPayload) GetSizeOk() (ret UpdateBackupPayloadGetSizeRetType, ok bool) { - return getUpdateBackupPayloadGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *UpdateBackupPayload) SetSize(v UpdateBackupPayloadGetSizeRetType) { - setUpdateBackupPayloadGetSizeAttributeType(&o.Size, v) -} - -// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetSnapshotId() (res UpdateBackupPayloadGetSnapshotIdRetType) { - res, _ = o.GetSnapshotIdOk() - return -} - -// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetSnapshotIdOk() (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { - return getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(o.SnapshotId) -} - -// HasSnapshotId returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasSnapshotId() bool { - _, ok := o.GetSnapshotIdOk() - return ok -} - -// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. -func (o *UpdateBackupPayload) SetSnapshotId(v UpdateBackupPayloadGetSnapshotIdRetType) { - setUpdateBackupPayloadGetSnapshotIdAttributeType(&o.SnapshotId, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetStatus() (res UpdateBackupPayloadGetStatusRetType) { - 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 *UpdateBackupPayload) GetStatusOk() (ret UpdateBackupPayloadGetStatusRetType, ok bool) { - return getUpdateBackupPayloadGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateBackupPayload) SetStatus(v UpdateBackupPayloadGetStatusRetType) { - setUpdateBackupPayloadGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetUpdatedAt() (res UpdateBackupPayloadGetUpdatedAtRetType) { - 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 *UpdateBackupPayload) GetUpdatedAtOk() (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { - return getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetUpdatedAt(v UpdateBackupPayloadGetUpdatedAtRetType) { - setUpdateBackupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetVolumeId() (res UpdateBackupPayloadGetVolumeIdRetType) { - res, _ = o.GetVolumeIdOk() - return -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetVolumeIdOk() (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { - return getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// HasVolumeId returns a boolean if a field has been set. -func (o *UpdateBackupPayload) HasVolumeId() bool { - _, ok := o.GetVolumeIdOk() - return ok -} - -// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *UpdateBackupPayload) SetVolumeId(v UpdateBackupPayloadGetVolumeIdRetType) { - setUpdateBackupPayloadGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getUpdateBackupPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getUpdateBackupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateBackupPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getUpdateBackupPayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(o.SnapshotId); ok { - toSerialize["SnapshotId"] = val - } - if val, ok := getUpdateBackupPayloadGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableUpdateBackupPayload struct { - value *UpdateBackupPayload - isSet bool -} - -func (v NullableUpdateBackupPayload) Get() *UpdateBackupPayload { - return v.value -} - -func (v *NullableUpdateBackupPayload) Set(val *UpdateBackupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateBackupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateBackupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateBackupPayload(val *UpdateBackupPayload) *NullableUpdateBackupPayload { - return &NullableUpdateBackupPayload{value: val, isSet: true} -} - -func (v NullableUpdateBackupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateBackupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_backup_payload_test.go b/services/iaasalpha/model_update_backup_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_backup_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_image_payload.go b/services/iaasalpha/model_update_image_payload.go deleted file mode 100644 index 8acd71b3b..000000000 --- a/services/iaasalpha/model_update_image_payload.go +++ /dev/null @@ -1,416 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateImagePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateImagePayload{} - -/* - types and functions for config -*/ - -// isModel -type UpdateImagePayloadGetConfigAttributeType = *ImageConfig -type UpdateImagePayloadGetConfigArgType = ImageConfig -type UpdateImagePayloadGetConfigRetType = ImageConfig - -func getUpdateImagePayloadGetConfigAttributeTypeOk(arg UpdateImagePayloadGetConfigAttributeType) (ret UpdateImagePayloadGetConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetConfigAttributeType(arg *UpdateImagePayloadGetConfigAttributeType, val UpdateImagePayloadGetConfigRetType) { - *arg = &val -} - -/* - types and functions for diskFormat -*/ - -// isNotNullableString -type UpdateImagePayloadGetDiskFormatAttributeType = *string - -func getUpdateImagePayloadGetDiskFormatAttributeTypeOk(arg UpdateImagePayloadGetDiskFormatAttributeType) (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetDiskFormatAttributeType(arg *UpdateImagePayloadGetDiskFormatAttributeType, val UpdateImagePayloadGetDiskFormatRetType) { - *arg = &val -} - -type UpdateImagePayloadGetDiskFormatArgType = string -type UpdateImagePayloadGetDiskFormatRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateImagePayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateImagePayloadGetLabelsArgType = map[string]interface{} -type UpdateImagePayloadGetLabelsRetType = map[string]interface{} - -func getUpdateImagePayloadGetLabelsAttributeTypeOk(arg UpdateImagePayloadGetLabelsAttributeType) (ret UpdateImagePayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetLabelsAttributeType(arg *UpdateImagePayloadGetLabelsAttributeType, val UpdateImagePayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for minDiskSize -*/ - -// isLong -type UpdateImagePayloadGetMinDiskSizeAttributeType = *int64 -type UpdateImagePayloadGetMinDiskSizeArgType = int64 -type UpdateImagePayloadGetMinDiskSizeRetType = int64 - -func getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(arg UpdateImagePayloadGetMinDiskSizeAttributeType) (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetMinDiskSizeAttributeType(arg *UpdateImagePayloadGetMinDiskSizeAttributeType, val UpdateImagePayloadGetMinDiskSizeRetType) { - *arg = &val -} - -/* - types and functions for minRam -*/ - -// isLong -type UpdateImagePayloadGetMinRamAttributeType = *int64 -type UpdateImagePayloadGetMinRamArgType = int64 -type UpdateImagePayloadGetMinRamRetType = int64 - -func getUpdateImagePayloadGetMinRamAttributeTypeOk(arg UpdateImagePayloadGetMinRamAttributeType) (ret UpdateImagePayloadGetMinRamRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetMinRamAttributeType(arg *UpdateImagePayloadGetMinRamAttributeType, val UpdateImagePayloadGetMinRamRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateImagePayloadGetNameAttributeType = *string - -func getUpdateImagePayloadGetNameAttributeTypeOk(arg UpdateImagePayloadGetNameAttributeType) (ret UpdateImagePayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadGetNameAttributeType(arg *UpdateImagePayloadGetNameAttributeType, val UpdateImagePayloadGetNameRetType) { - *arg = &val -} - -type UpdateImagePayloadGetNameArgType = string -type UpdateImagePayloadGetNameRetType = string - -/* - types and functions for protected -*/ - -// isBoolean -type UpdateImagePayloadgetProtectedAttributeType = *bool -type UpdateImagePayloadgetProtectedArgType = bool -type UpdateImagePayloadgetProtectedRetType = bool - -func getUpdateImagePayloadgetProtectedAttributeTypeOk(arg UpdateImagePayloadgetProtectedAttributeType) (ret UpdateImagePayloadgetProtectedRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImagePayloadgetProtectedAttributeType(arg *UpdateImagePayloadgetProtectedAttributeType, val UpdateImagePayloadgetProtectedRetType) { - *arg = &val -} - -// UpdateImagePayload Object that represents an update request body of an Image. -type UpdateImagePayload struct { - Config UpdateImagePayloadGetConfigAttributeType `json:"config,omitempty"` - // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. - DiskFormat UpdateImagePayloadGetDiskFormatAttributeType `json:"diskFormat,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Size in Gigabyte. - MinDiskSize UpdateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` - // Size in Megabyte. - MinRam UpdateImagePayloadGetMinRamAttributeType `json:"minRam,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateImagePayloadGetNameAttributeType `json:"name,omitempty"` - Protected UpdateImagePayloadgetProtectedAttributeType `json:"protected,omitempty"` -} - -// NewUpdateImagePayload instantiates a new UpdateImagePayload 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 NewUpdateImagePayload() *UpdateImagePayload { - this := UpdateImagePayload{} - return &this -} - -// NewUpdateImagePayloadWithDefaults instantiates a new UpdateImagePayload 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 NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { - this := UpdateImagePayload{} - return &this -} - -// GetConfig returns the Config field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetConfig() (res UpdateImagePayloadGetConfigRetType) { - res, _ = o.GetConfigOk() - return -} - -// GetConfigOk returns a tuple with the Config field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetConfigOk() (ret UpdateImagePayloadGetConfigRetType, ok bool) { - return getUpdateImagePayloadGetConfigAttributeTypeOk(o.Config) -} - -// HasConfig returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasConfig() bool { - _, ok := o.GetConfigOk() - return ok -} - -// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *UpdateImagePayload) SetConfig(v UpdateImagePayloadGetConfigRetType) { - setUpdateImagePayloadGetConfigAttributeType(&o.Config, v) -} - -// GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetDiskFormat() (res UpdateImagePayloadGetDiskFormatRetType) { - res, _ = o.GetDiskFormatOk() - return -} - -// GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetDiskFormatOk() (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { - return getUpdateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) -} - -// HasDiskFormat returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasDiskFormat() bool { - _, ok := o.GetDiskFormatOk() - return ok -} - -// SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. -func (o *UpdateImagePayload) SetDiskFormat(v UpdateImagePayloadGetDiskFormatRetType) { - setUpdateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetLabels() (res UpdateImagePayloadGetLabelsRetType) { - 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 *UpdateImagePayload) GetLabelsOk() (ret UpdateImagePayloadGetLabelsRetType, ok bool) { - return getUpdateImagePayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateImagePayload) 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 *UpdateImagePayload) SetLabels(v UpdateImagePayloadGetLabelsRetType) { - setUpdateImagePayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetMinDiskSize() (res UpdateImagePayloadGetMinDiskSizeRetType) { - res, _ = o.GetMinDiskSizeOk() - return -} - -// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetMinDiskSizeOk() (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { - return getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) -} - -// HasMinDiskSize returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasMinDiskSize() bool { - _, ok := o.GetMinDiskSizeOk() - return ok -} - -// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *UpdateImagePayload) SetMinDiskSize(v UpdateImagePayloadGetMinDiskSizeRetType) { - setUpdateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) -} - -// GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetMinRam() (res UpdateImagePayloadGetMinRamRetType) { - res, _ = o.GetMinRamOk() - return -} - -// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetMinRamOk() (ret UpdateImagePayloadGetMinRamRetType, ok bool) { - return getUpdateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) -} - -// HasMinRam returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasMinRam() bool { - _, ok := o.GetMinRamOk() - return ok -} - -// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *UpdateImagePayload) SetMinRam(v UpdateImagePayloadGetMinRamRetType) { - setUpdateImagePayloadGetMinRamAttributeType(&o.MinRam, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetName() (res UpdateImagePayloadGetNameRetType) { - 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 *UpdateImagePayload) GetNameOk() (ret UpdateImagePayloadGetNameRetType, ok bool) { - return getUpdateImagePayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateImagePayload) SetName(v UpdateImagePayloadGetNameRetType) { - setUpdateImagePayloadGetNameAttributeType(&o.Name, v) -} - -// GetProtected returns the Protected field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetProtected() (res UpdateImagePayloadgetProtectedRetType) { - res, _ = o.GetProtectedOk() - return -} - -// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetProtectedOk() (ret UpdateImagePayloadgetProtectedRetType, ok bool) { - return getUpdateImagePayloadgetProtectedAttributeTypeOk(o.Protected) -} - -// HasProtected returns a boolean if a field has been set. -func (o *UpdateImagePayload) HasProtected() bool { - _, ok := o.GetProtectedOk() - return ok -} - -// SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *UpdateImagePayload) SetProtected(v UpdateImagePayloadgetProtectedRetType) { - setUpdateImagePayloadgetProtectedAttributeType(&o.Protected, v) -} - -func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateImagePayloadGetConfigAttributeTypeOk(o.Config); ok { - toSerialize["Config"] = val - } - if val, ok := getUpdateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { - toSerialize["DiskFormat"] = val - } - if val, ok := getUpdateImagePayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { - toSerialize["MinDiskSize"] = val - } - if val, ok := getUpdateImagePayloadGetMinRamAttributeTypeOk(o.MinRam); ok { - toSerialize["MinRam"] = val - } - if val, ok := getUpdateImagePayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getUpdateImagePayloadgetProtectedAttributeTypeOk(o.Protected); ok { - toSerialize["Protected"] = val - } - return toSerialize, nil -} - -type NullableUpdateImagePayload struct { - value *UpdateImagePayload - isSet bool -} - -func (v NullableUpdateImagePayload) Get() *UpdateImagePayload { - return v.value -} - -func (v *NullableUpdateImagePayload) Set(val *UpdateImagePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateImagePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateImagePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateImagePayload(val *UpdateImagePayload) *NullableUpdateImagePayload { - return &NullableUpdateImagePayload{value: val, isSet: true} -} - -func (v NullableUpdateImagePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateImagePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_image_payload_test.go b/services/iaasalpha/model_update_image_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_image_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_image_share_payload.go b/services/iaasalpha/model_update_image_share_payload.go deleted file mode 100644 index 4e78491e4..000000000 --- a/services/iaasalpha/model_update_image_share_payload.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateImageSharePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateImageSharePayload{} - -/* - types and functions for parentOrganization -*/ - -// isBoolean -type UpdateImageSharePayloadgetParentOrganizationAttributeType = *bool -type UpdateImageSharePayloadgetParentOrganizationArgType = bool -type UpdateImageSharePayloadgetParentOrganizationRetType = bool - -func getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(arg UpdateImageSharePayloadgetParentOrganizationAttributeType) (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImageSharePayloadgetParentOrganizationAttributeType(arg *UpdateImageSharePayloadgetParentOrganizationAttributeType, val UpdateImageSharePayloadgetParentOrganizationRetType) { - *arg = &val -} - -/* - types and functions for projects -*/ - -// isArray -type UpdateImageSharePayloadGetProjectsAttributeType = *[]string -type UpdateImageSharePayloadGetProjectsArgType = []string -type UpdateImageSharePayloadGetProjectsRetType = []string - -func getUpdateImageSharePayloadGetProjectsAttributeTypeOk(arg UpdateImageSharePayloadGetProjectsAttributeType) (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateImageSharePayloadGetProjectsAttributeType(arg *UpdateImageSharePayloadGetProjectsAttributeType, val UpdateImageSharePayloadGetProjectsRetType) { - *arg = &val -} - -// UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. -type UpdateImageSharePayload struct { - // Image is shared with all projects inside the image owners organization. - ParentOrganization UpdateImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` - // List of all projects the Image is shared with. - Projects UpdateImageSharePayloadGetProjectsAttributeType `json:"projects,omitempty"` -} - -// NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload 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 NewUpdateImageSharePayload() *UpdateImageSharePayload { - this := UpdateImageSharePayload{} - return &this -} - -// NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload 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 NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { - this := UpdateImageSharePayload{} - return &this -} - -// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *UpdateImageSharePayload) GetParentOrganization() (res UpdateImageSharePayloadgetParentOrganizationRetType) { - res, _ = o.GetParentOrganizationOk() - return -} - -// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImageSharePayload) GetParentOrganizationOk() (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { - return getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) -} - -// HasParentOrganization returns a boolean if a field has been set. -func (o *UpdateImageSharePayload) HasParentOrganization() bool { - _, ok := o.GetParentOrganizationOk() - return ok -} - -// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *UpdateImageSharePayload) SetParentOrganization(v UpdateImageSharePayloadgetParentOrganizationRetType) { - setUpdateImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) -} - -// GetProjects returns the Projects field value if set, zero value otherwise. -func (o *UpdateImageSharePayload) GetProjects() (res UpdateImageSharePayloadGetProjectsRetType) { - res, _ = o.GetProjectsOk() - return -} - -// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateImageSharePayload) GetProjectsOk() (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { - return getUpdateImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) -} - -// HasProjects returns a boolean if a field has been set. -func (o *UpdateImageSharePayload) HasProjects() bool { - _, ok := o.GetProjectsOk() - return ok -} - -// SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *UpdateImageSharePayload) SetProjects(v UpdateImageSharePayloadGetProjectsRetType) { - setUpdateImageSharePayloadGetProjectsAttributeType(&o.Projects, v) -} - -func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { - toSerialize["ParentOrganization"] = val - } - if val, ok := getUpdateImageSharePayloadGetProjectsAttributeTypeOk(o.Projects); ok { - toSerialize["Projects"] = val - } - return toSerialize, nil -} - -type NullableUpdateImageSharePayload struct { - value *UpdateImageSharePayload - isSet bool -} - -func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { - return v.value -} - -func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateImageSharePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateImageSharePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { - return &NullableUpdateImageSharePayload{value: val, isSet: true} -} - -func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_image_share_payload_test.go b/services/iaasalpha/model_update_image_share_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_image_share_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_key_pair_payload.go b/services/iaasalpha/model_update_key_pair_payload.go deleted file mode 100644 index 119ae2db4..000000000 --- a/services/iaasalpha/model_update_key_pair_payload.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateKeyPairPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateKeyPairPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateKeyPairPayloadGetLabelsArgType = map[string]interface{} -type UpdateKeyPairPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(arg UpdateKeyPairPayloadGetLabelsAttributeType) (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateKeyPairPayloadGetLabelsAttributeType(arg *UpdateKeyPairPayloadGetLabelsAttributeType, val UpdateKeyPairPayloadGetLabelsRetType) { - *arg = &val -} - -// UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. -type UpdateKeyPairPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` -} - -// NewUpdateKeyPairPayload instantiates a new UpdateKeyPairPayload 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 NewUpdateKeyPairPayload() *UpdateKeyPairPayload { - this := UpdateKeyPairPayload{} - return &this -} - -// NewUpdateKeyPairPayloadWithDefaults instantiates a new UpdateKeyPairPayload 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 NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { - this := UpdateKeyPairPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateKeyPairPayload) GetLabels() (res UpdateKeyPairPayloadGetLabelsRetType) { - 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 *UpdateKeyPairPayload) GetLabelsOk() (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { - return getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateKeyPairPayload) 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 *UpdateKeyPairPayload) SetLabels(v UpdateKeyPairPayloadGetLabelsRetType) { - setUpdateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) -} - -func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - return toSerialize, nil -} - -type NullableUpdateKeyPairPayload struct { - value *UpdateKeyPairPayload - isSet bool -} - -func (v NullableUpdateKeyPairPayload) Get() *UpdateKeyPairPayload { - return v.value -} - -func (v *NullableUpdateKeyPairPayload) Set(val *UpdateKeyPairPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateKeyPairPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateKeyPairPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateKeyPairPayload(val *UpdateKeyPairPayload) *NullableUpdateKeyPairPayload { - return &NullableUpdateKeyPairPayload{value: val, isSet: true} -} - -func (v NullableUpdateKeyPairPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateKeyPairPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_key_pair_payload_test.go b/services/iaasalpha/model_update_key_pair_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_key_pair_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_network_address_family.go b/services/iaasalpha/model_update_network_address_family.go deleted file mode 100644 index 1cf5d36e2..000000000 --- a/services/iaasalpha/model_update_network_address_family.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateNetworkAddressFamily type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateNetworkAddressFamily{} - -/* - types and functions for ipv4 -*/ - -// isModel -type UpdateNetworkAddressFamilyGetIpv4AttributeType = *UpdateNetworkIPv4Body -type UpdateNetworkAddressFamilyGetIpv4ArgType = UpdateNetworkIPv4Body -type UpdateNetworkAddressFamilyGetIpv4RetType = UpdateNetworkIPv4Body - -func getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(arg UpdateNetworkAddressFamilyGetIpv4AttributeType) (ret UpdateNetworkAddressFamilyGetIpv4RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNetworkAddressFamilyGetIpv4AttributeType(arg *UpdateNetworkAddressFamilyGetIpv4AttributeType, val UpdateNetworkAddressFamilyGetIpv4RetType) { - *arg = &val -} - -/* - types and functions for ipv6 -*/ - -// isModel -type UpdateNetworkAddressFamilyGetIpv6AttributeType = *UpdateNetworkIPv6Body -type UpdateNetworkAddressFamilyGetIpv6ArgType = UpdateNetworkIPv6Body -type UpdateNetworkAddressFamilyGetIpv6RetType = UpdateNetworkIPv6Body - -func getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(arg UpdateNetworkAddressFamilyGetIpv6AttributeType) (ret UpdateNetworkAddressFamilyGetIpv6RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNetworkAddressFamilyGetIpv6AttributeType(arg *UpdateNetworkAddressFamilyGetIpv6AttributeType, val UpdateNetworkAddressFamilyGetIpv6RetType) { - *arg = &val -} - -// UpdateNetworkAddressFamily The addressFamily object for a network update request. -type UpdateNetworkAddressFamily struct { - Ipv4 UpdateNetworkAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` - Ipv6 UpdateNetworkAddressFamilyGetIpv6AttributeType `json:"ipv6,omitempty"` -} - -// NewUpdateNetworkAddressFamily instantiates a new UpdateNetworkAddressFamily 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 NewUpdateNetworkAddressFamily() *UpdateNetworkAddressFamily { - this := UpdateNetworkAddressFamily{} - return &this -} - -// NewUpdateNetworkAddressFamilyWithDefaults instantiates a new UpdateNetworkAddressFamily 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 NewUpdateNetworkAddressFamilyWithDefaults() *UpdateNetworkAddressFamily { - this := UpdateNetworkAddressFamily{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *UpdateNetworkAddressFamily) GetIpv4() (res UpdateNetworkAddressFamilyGetIpv4RetType) { - 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 *UpdateNetworkAddressFamily) GetIpv4Ok() (ret UpdateNetworkAddressFamilyGetIpv4RetType, ok bool) { - return getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *UpdateNetworkAddressFamily) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok -} - -// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. -func (o *UpdateNetworkAddressFamily) SetIpv4(v UpdateNetworkAddressFamilyGetIpv4RetType) { - setUpdateNetworkAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *UpdateNetworkAddressFamily) GetIpv6() (res UpdateNetworkAddressFamilyGetIpv6RetType) { - 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 *UpdateNetworkAddressFamily) GetIpv6Ok() (ret UpdateNetworkAddressFamilyGetIpv6RetType, ok bool) { - return getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6) -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *UpdateNetworkAddressFamily) HasIpv6() bool { - _, ok := o.GetIpv6Ok() - return ok -} - -// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. -func (o *UpdateNetworkAddressFamily) SetIpv6(v UpdateNetworkAddressFamilyGetIpv6RetType) { - setUpdateNetworkAddressFamilyGetIpv6AttributeType(&o.Ipv6, v) -} - -func (o UpdateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val - } - if val, ok := getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6); ok { - toSerialize["Ipv6"] = val - } - return toSerialize, nil -} - -type NullableUpdateNetworkAddressFamily struct { - value *UpdateNetworkAddressFamily - isSet bool -} - -func (v NullableUpdateNetworkAddressFamily) Get() *UpdateNetworkAddressFamily { - return v.value -} - -func (v *NullableUpdateNetworkAddressFamily) Set(val *UpdateNetworkAddressFamily) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateNetworkAddressFamily) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateNetworkAddressFamily) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateNetworkAddressFamily(val *UpdateNetworkAddressFamily) *NullableUpdateNetworkAddressFamily { - return &NullableUpdateNetworkAddressFamily{value: val, isSet: true} -} - -func (v NullableUpdateNetworkAddressFamily) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateNetworkAddressFamily) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_network_address_family_test.go b/services/iaasalpha/model_update_network_address_family_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_network_address_family_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_network_ipv4_body.go b/services/iaasalpha/model_update_network_ipv4_body.go index 34592230e..8d5d04399 100644 --- a/services/iaasalpha/model_update_network_ipv4_body.go +++ b/services/iaasalpha/model_update_network_ipv4_body.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,27 +21,22 @@ var _ MappedNullable = &UpdateNetworkIPv4Body{} types and functions for gateway */ -// isNullableString -type UpdateNetworkIPv4BodyGetGatewayAttributeType = *NullableString +// isModel +type UpdateNetworkIPv4BodyGetGatewayAttributeType = *NullableNetworkGatewayIPv4 +type UpdateNetworkIPv4BodyGetGatewayArgType = *NullableNetworkGatewayIPv4 +type UpdateNetworkIPv4BodyGetGatewayRetType = *NullableNetworkGatewayIPv4 func getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv4BodyGetGatewayAttributeType) (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { if arg == nil { return nil, false } - return arg.Get(), true + return arg, true } func setUpdateNetworkIPv4BodyGetGatewayAttributeType(arg *UpdateNetworkIPv4BodyGetGatewayAttributeType, val UpdateNetworkIPv4BodyGetGatewayRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } + *arg = val } -type UpdateNetworkIPv4BodyGetGatewayArgType = *string -type UpdateNetworkIPv4BodyGetGatewayRetType = *string - /* types and functions for nameservers */ @@ -64,7 +59,6 @@ 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. Gateway UpdateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. Nameservers UpdateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` @@ -106,7 +100,7 @@ func (o *UpdateNetworkIPv4Body) HasGateway() bool { return ok } -// SetGateway gets a reference to the given string and assigns it to the Gateway field. +// SetGateway gets a reference to the given NetworkGatewayIPv4 and assigns it to the Gateway field. func (o *UpdateNetworkIPv4Body) SetGateway(v UpdateNetworkIPv4BodyGetGatewayRetType) { setUpdateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) } diff --git a/services/iaasalpha/model_update_network_ipv4_body_test.go b/services/iaasalpha/model_update_network_ipv4_body_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_update_network_ipv4_body_test.go +++ b/services/iaasalpha/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: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_update_network_ipv6_body.go b/services/iaasalpha/model_update_network_ipv6_body.go index db8d6093f..d036cb66d 100644 --- a/services/iaasalpha/model_update_network_ipv6_body.go +++ b/services/iaasalpha/model_update_network_ipv6_body.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,27 +21,22 @@ var _ MappedNullable = &UpdateNetworkIPv6Body{} types and functions for gateway */ -// isNullableString -type UpdateNetworkIPv6BodyGetGatewayAttributeType = *NullableString +// isModel +type UpdateNetworkIPv6BodyGetGatewayAttributeType = *NullableNetworkGatewayIPv6 +type UpdateNetworkIPv6BodyGetGatewayArgType = *NullableNetworkGatewayIPv6 +type UpdateNetworkIPv6BodyGetGatewayRetType = *NullableNetworkGatewayIPv6 func getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv6BodyGetGatewayAttributeType) (ret UpdateNetworkIPv6BodyGetGatewayRetType, ok bool) { if arg == nil { return nil, false } - return arg.Get(), true + return arg, true } func setUpdateNetworkIPv6BodyGetGatewayAttributeType(arg *UpdateNetworkIPv6BodyGetGatewayAttributeType, val UpdateNetworkIPv6BodyGetGatewayRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } + *arg = val } -type UpdateNetworkIPv6BodyGetGatewayArgType = *string -type UpdateNetworkIPv6BodyGetGatewayRetType = *string - /* types and functions for nameservers */ @@ -64,7 +59,6 @@ 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. Gateway UpdateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv6. Nameservers UpdateNetworkIPv6BodyGetNameserversAttributeType `json:"nameservers,omitempty"` @@ -106,7 +100,7 @@ func (o *UpdateNetworkIPv6Body) HasGateway() bool { return ok } -// SetGateway gets a reference to the given string and assigns it to the Gateway field. +// SetGateway gets a reference to the given NetworkGatewayIPv6 and assigns it to the Gateway field. func (o *UpdateNetworkIPv6Body) SetGateway(v UpdateNetworkIPv6BodyGetGatewayRetType) { setUpdateNetworkIPv6BodyGetGatewayAttributeType(&o.Gateway, v) } diff --git a/services/iaasalpha/model_update_network_ipv6_body_test.go b/services/iaasalpha/model_update_network_ipv6_body_test.go index 3a7814d4e..7b8f0d01a 100644 --- a/services/iaasalpha/model_update_network_ipv6_body_test.go +++ b/services/iaasalpha/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: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaasalpha/model_update_nic_payload.go b/services/iaasalpha/model_update_nic_payload.go deleted file mode 100644 index 539ea8e87..000000000 --- a/services/iaasalpha/model_update_nic_payload.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateNicPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateNicPayload{} - -/* - types and functions for allowedAddresses -*/ - -// isArray -type UpdateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner -type UpdateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner -type UpdateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner - -func getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(arg UpdateNicPayloadGetAllowedAddressesAttributeType) (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNicPayloadGetAllowedAddressesAttributeType(arg *UpdateNicPayloadGetAllowedAddressesAttributeType, val UpdateNicPayloadGetAllowedAddressesRetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateNicPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateNicPayloadGetLabelsArgType = map[string]interface{} -type UpdateNicPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateNicPayloadGetLabelsAttributeTypeOk(arg UpdateNicPayloadGetLabelsAttributeType) (ret UpdateNicPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNicPayloadGetLabelsAttributeType(arg *UpdateNicPayloadGetLabelsAttributeType, val UpdateNicPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateNicPayloadGetNameAttributeType = *string - -func getUpdateNicPayloadGetNameAttributeTypeOk(arg UpdateNicPayloadGetNameAttributeType) (ret UpdateNicPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNicPayloadGetNameAttributeType(arg *UpdateNicPayloadGetNameAttributeType, val UpdateNicPayloadGetNameRetType) { - *arg = &val -} - -type UpdateNicPayloadGetNameArgType = string -type UpdateNicPayloadGetNameRetType = string - -/* - types and functions for nicSecurity -*/ - -// isBoolean -type UpdateNicPayloadgetNicSecurityAttributeType = *bool -type UpdateNicPayloadgetNicSecurityArgType = bool -type UpdateNicPayloadgetNicSecurityRetType = bool - -func getUpdateNicPayloadgetNicSecurityAttributeTypeOk(arg UpdateNicPayloadgetNicSecurityAttributeType) (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNicPayloadgetNicSecurityAttributeType(arg *UpdateNicPayloadgetNicSecurityAttributeType, val UpdateNicPayloadgetNicSecurityRetType) { - *arg = &val -} - -/* - types and functions for securityGroups -*/ - -// isArray -type UpdateNicPayloadGetSecurityGroupsAttributeType = *[]string -type UpdateNicPayloadGetSecurityGroupsArgType = []string -type UpdateNicPayloadGetSecurityGroupsRetType = []string - -func getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(arg UpdateNicPayloadGetSecurityGroupsAttributeType) (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateNicPayloadGetSecurityGroupsAttributeType(arg *UpdateNicPayloadGetSecurityGroupsAttributeType, val UpdateNicPayloadGetSecurityGroupsRetType) { - *arg = &val -} - -// UpdateNicPayload Object that represents a network interface update. -type UpdateNicPayload struct { - // A list of IPs or CIDR notations. - AllowedAddresses UpdateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateNicPayloadGetNameAttributeType `json:"name,omitempty"` - // If this is set to false, then no security groups will apply to this network interface. - NicSecurity UpdateNicPayloadgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` - // A list of UUIDs. - SecurityGroups UpdateNicPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` -} - -// NewUpdateNicPayload instantiates a new UpdateNicPayload 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 NewUpdateNicPayload() *UpdateNicPayload { - this := UpdateNicPayload{} - return &this -} - -// NewUpdateNicPayloadWithDefaults instantiates a new UpdateNicPayload 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 NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { - this := UpdateNicPayload{} - return &this -} - -// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetAllowedAddresses() (res UpdateNicPayloadGetAllowedAddressesRetType) { - res, _ = o.GetAllowedAddressesOk() - return -} - -// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetAllowedAddressesOk() (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { - return getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) -} - -// HasAllowedAddresses returns a boolean if a field has been set. -func (o *UpdateNicPayload) HasAllowedAddresses() bool { - _, ok := o.GetAllowedAddressesOk() - return ok -} - -// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *UpdateNicPayload) SetAllowedAddresses(v UpdateNicPayloadGetAllowedAddressesRetType) { - setUpdateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetLabels() (res UpdateNicPayloadGetLabelsRetType) { - 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 *UpdateNicPayload) GetLabelsOk() (ret UpdateNicPayloadGetLabelsRetType, ok bool) { - return getUpdateNicPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateNicPayload) 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 *UpdateNicPayload) SetLabels(v UpdateNicPayloadGetLabelsRetType) { - setUpdateNicPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetName() (res UpdateNicPayloadGetNameRetType) { - 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 *UpdateNicPayload) GetNameOk() (ret UpdateNicPayloadGetNameRetType, ok bool) { - return getUpdateNicPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateNicPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateNicPayload) SetName(v UpdateNicPayloadGetNameRetType) { - setUpdateNicPayloadGetNameAttributeType(&o.Name, v) -} - -// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetNicSecurity() (res UpdateNicPayloadgetNicSecurityRetType) { - res, _ = o.GetNicSecurityOk() - return -} - -// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetNicSecurityOk() (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { - return getUpdateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) -} - -// HasNicSecurity returns a boolean if a field has been set. -func (o *UpdateNicPayload) HasNicSecurity() bool { - _, ok := o.GetNicSecurityOk() - return ok -} - -// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *UpdateNicPayload) SetNicSecurity(v UpdateNicPayloadgetNicSecurityRetType) { - setUpdateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) -} - -// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetSecurityGroups() (res UpdateNicPayloadGetSecurityGroupsRetType) { - res, _ = o.GetSecurityGroupsOk() - return -} - -// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetSecurityGroupsOk() (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { - return getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) -} - -// HasSecurityGroups returns a boolean if a field has been set. -func (o *UpdateNicPayload) HasSecurityGroups() bool { - _, ok := o.GetSecurityGroupsOk() - return ok -} - -// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *UpdateNicPayload) SetSecurityGroups(v UpdateNicPayloadGetSecurityGroupsRetType) { - setUpdateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) -} - -func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { - toSerialize["AllowedAddresses"] = val - } - if val, ok := getUpdateNicPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateNicPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getUpdateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { - toSerialize["NicSecurity"] = val - } - if val, ok := getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { - toSerialize["SecurityGroups"] = val - } - return toSerialize, nil -} - -type NullableUpdateNicPayload struct { - value *UpdateNicPayload - isSet bool -} - -func (v NullableUpdateNicPayload) Get() *UpdateNicPayload { - return v.value -} - -func (v *NullableUpdateNicPayload) Set(val *UpdateNicPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateNicPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateNicPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateNicPayload(val *UpdateNicPayload) *NullableUpdateNicPayload { - return &NullableUpdateNicPayload{value: val, isSet: true} -} - -func (v NullableUpdateNicPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateNicPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_nic_payload_test.go b/services/iaasalpha/model_update_nic_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_nic_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_public_ip_payload.go b/services/iaasalpha/model_update_public_ip_payload.go deleted file mode 100644 index 54df182d0..000000000 --- a/services/iaasalpha/model_update_public_ip_payload.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdatePublicIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdatePublicIPPayload{} - -/* - types and functions for id -*/ - -// isNotNullableString -type UpdatePublicIPPayloadGetIdAttributeType = *string - -func getUpdatePublicIPPayloadGetIdAttributeTypeOk(arg UpdatePublicIPPayloadGetIdAttributeType) (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdatePublicIPPayloadGetIdAttributeType(arg *UpdatePublicIPPayloadGetIdAttributeType, val UpdatePublicIPPayloadGetIdRetType) { - *arg = &val -} - -type UpdatePublicIPPayloadGetIdArgType = string -type UpdatePublicIPPayloadGetIdRetType = string - -/* - types and functions for ip -*/ - -// isNotNullableString -type UpdatePublicIPPayloadGetIpAttributeType = *string - -func getUpdatePublicIPPayloadGetIpAttributeTypeOk(arg UpdatePublicIPPayloadGetIpAttributeType) (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdatePublicIPPayloadGetIpAttributeType(arg *UpdatePublicIPPayloadGetIpAttributeType, val UpdatePublicIPPayloadGetIpRetType) { - *arg = &val -} - -type UpdatePublicIPPayloadGetIpArgType = string -type UpdatePublicIPPayloadGetIpRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type UpdatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdatePublicIPPayloadGetLabelsArgType = map[string]interface{} -type UpdatePublicIPPayloadGetLabelsRetType = map[string]interface{} - -func getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(arg UpdatePublicIPPayloadGetLabelsAttributeType) (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdatePublicIPPayloadGetLabelsAttributeType(arg *UpdatePublicIPPayloadGetLabelsAttributeType, val UpdatePublicIPPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for networkInterface -*/ - -// isNullableString -type UpdatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString - -func getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg UpdatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *UpdatePublicIPPayloadGetNetworkInterfaceAttributeType, val UpdatePublicIPPayloadGetNetworkInterfaceRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type UpdatePublicIPPayloadGetNetworkInterfaceArgType = *string -type UpdatePublicIPPayloadGetNetworkInterfaceRetType = *string - -// UpdatePublicIPPayload Object that represents a public IP. -type UpdatePublicIPPayload struct { - // Universally Unique Identifier (UUID). - Id UpdatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ip UpdatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Universally Unique Identifier (UUID). - NetworkInterface UpdatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` -} - -// NewUpdatePublicIPPayload instantiates a new UpdatePublicIPPayload 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 NewUpdatePublicIPPayload() *UpdatePublicIPPayload { - this := UpdatePublicIPPayload{} - return &this -} - -// NewUpdatePublicIPPayloadWithDefaults instantiates a new UpdatePublicIPPayload 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 NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { - this := UpdatePublicIPPayload{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetId() (res UpdatePublicIPPayloadGetIdRetType) { - 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 *UpdatePublicIPPayload) GetIdOk() (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { - return getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *UpdatePublicIPPayload) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *UpdatePublicIPPayload) SetId(v UpdatePublicIPPayloadGetIdRetType) { - setUpdatePublicIPPayloadGetIdAttributeType(&o.Id, v) -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetIp() (res UpdatePublicIPPayloadGetIpRetType) { - res, _ = o.GetIpOk() - return -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdatePublicIPPayload) GetIpOk() (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { - return getUpdatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) -} - -// HasIp returns a boolean if a field has been set. -func (o *UpdatePublicIPPayload) HasIp() bool { - _, ok := o.GetIpOk() - return ok -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *UpdatePublicIPPayload) SetIp(v UpdatePublicIPPayloadGetIpRetType) { - setUpdatePublicIPPayloadGetIpAttributeType(&o.Ip, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetLabels() (res UpdatePublicIPPayloadGetLabelsRetType) { - 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 *UpdatePublicIPPayload) GetLabelsOk() (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { - return getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdatePublicIPPayload) 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 *UpdatePublicIPPayload) SetLabels(v UpdatePublicIPPayloadGetLabelsRetType) { - setUpdatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdatePublicIPPayload) GetNetworkInterface() (res UpdatePublicIPPayloadGetNetworkInterfaceRetType) { - res, _ = o.GetNetworkInterfaceOk() - return -} - -// GetNetworkInterfaceOk returns a tuple with the NetworkInterface 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 *UpdatePublicIPPayload) GetNetworkInterfaceOk() (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { - return getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) -} - -// HasNetworkInterface returns a boolean if a field has been set. -func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { - _, ok := o.GetNetworkInterfaceOk() - return ok -} - -// SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *UpdatePublicIPPayload) SetNetworkInterface(v UpdatePublicIPPayloadGetNetworkInterfaceRetType) { - setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) -} - -// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil -func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { - o.NetworkInterface = nil -} - -// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil -func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { - o.NetworkInterface = nil -} - -func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getUpdatePublicIPPayloadGetIpAttributeTypeOk(o.Ip); ok { - toSerialize["Ip"] = val - } - if val, ok := getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { - toSerialize["NetworkInterface"] = val - } - return toSerialize, nil -} - -type NullableUpdatePublicIPPayload struct { - value *UpdatePublicIPPayload - isSet bool -} - -func (v NullableUpdatePublicIPPayload) Get() *UpdatePublicIPPayload { - return v.value -} - -func (v *NullableUpdatePublicIPPayload) Set(val *UpdatePublicIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdatePublicIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdatePublicIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdatePublicIPPayload(val *UpdatePublicIPPayload) *NullableUpdatePublicIPPayload { - return &NullableUpdatePublicIPPayload{value: val, isSet: true} -} - -func (v NullableUpdatePublicIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdatePublicIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_public_ip_payload_test.go b/services/iaasalpha/model_update_public_ip_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_public_ip_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_route_of_routing_table_payload.go b/services/iaasalpha/model_update_route_of_routing_table_payload.go new file mode 100644 index 000000000..528fdbcdf --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. + 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/iaasalpha/model_update_route_of_routing_table_payload_test.go b/services/iaasalpha/model_update_route_of_routing_table_payload_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_update_routing_table_of_area_payload.go b/services/iaasalpha/model_update_routing_table_of_area_payload.go new file mode 100644 index 000000000..c69988073 --- /dev/null +++ b/services/iaasalpha/model_update_routing_table_of_area_payload.go @@ -0,0 +1,226 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +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 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"` + // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. + 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{} + 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) +} + +// 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 := 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/iaasalpha/model_update_routing_table_of_area_payload_test.go b/services/iaasalpha/model_update_routing_table_of_area_payload_test.go new file mode 100644 index 000000000..7b8f0d01a --- /dev/null +++ b/services/iaasalpha/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: 2alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha diff --git a/services/iaasalpha/model_update_security_group_payload.go b/services/iaasalpha/model_update_security_group_payload.go deleted file mode 100644 index ca45b79ff..000000000 --- a/services/iaasalpha/model_update_security_group_payload.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateSecurityGroupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateSecurityGroupPayload{} - -/* - types and functions for description -*/ - -// isNotNullableString -type UpdateSecurityGroupPayloadGetDescriptionAttributeType = *string - -func getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg UpdateSecurityGroupPayloadGetDescriptionAttributeType) (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateSecurityGroupPayloadGetDescriptionAttributeType(arg *UpdateSecurityGroupPayloadGetDescriptionAttributeType, val UpdateSecurityGroupPayloadGetDescriptionRetType) { - *arg = &val -} - -type UpdateSecurityGroupPayloadGetDescriptionArgType = string -type UpdateSecurityGroupPayloadGetDescriptionRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} -type UpdateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg UpdateSecurityGroupPayloadGetLabelsAttributeType) (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateSecurityGroupPayloadGetLabelsAttributeType(arg *UpdateSecurityGroupPayloadGetLabelsAttributeType, val UpdateSecurityGroupPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateSecurityGroupPayloadGetNameAttributeType = *string - -func getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(arg UpdateSecurityGroupPayloadGetNameAttributeType) (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateSecurityGroupPayloadGetNameAttributeType(arg *UpdateSecurityGroupPayloadGetNameAttributeType, val UpdateSecurityGroupPayloadGetNameRetType) { - *arg = &val -} - -type UpdateSecurityGroupPayloadGetNameArgType = string -type UpdateSecurityGroupPayloadGetNameRetType = string - -// UpdateSecurityGroupPayload Object that represents an update request body of a security group. -type UpdateSecurityGroupPayload struct { - // Description Object. Allows string up to 255 Characters. - Description UpdateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateSecurityGroupPayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewUpdateSecurityGroupPayload instantiates a new UpdateSecurityGroupPayload 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 NewUpdateSecurityGroupPayload() *UpdateSecurityGroupPayload { - this := UpdateSecurityGroupPayload{} - return &this -} - -// NewUpdateSecurityGroupPayloadWithDefaults instantiates a new UpdateSecurityGroupPayload 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 NewUpdateSecurityGroupPayloadWithDefaults() *UpdateSecurityGroupPayload { - this := UpdateSecurityGroupPayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetDescription() (res UpdateSecurityGroupPayloadGetDescriptionRetType) { - 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 *UpdateSecurityGroupPayload) GetDescriptionOk() (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { - return getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateSecurityGroupPayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdateSecurityGroupPayload) SetDescription(v UpdateSecurityGroupPayloadGetDescriptionRetType) { - setUpdateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetLabels() (res UpdateSecurityGroupPayloadGetLabelsRetType) { - 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 *UpdateSecurityGroupPayload) GetLabelsOk() (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { - return getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateSecurityGroupPayload) 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 *UpdateSecurityGroupPayload) SetLabels(v UpdateSecurityGroupPayloadGetLabelsRetType) { - setUpdateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetName() (res UpdateSecurityGroupPayloadGetNameRetType) { - 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 *UpdateSecurityGroupPayload) GetNameOk() (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { - return getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateSecurityGroupPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateSecurityGroupPayload) SetName(v UpdateSecurityGroupPayloadGetNameRetType) { - setUpdateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) -} - -func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableUpdateSecurityGroupPayload struct { - value *UpdateSecurityGroupPayload - isSet bool -} - -func (v NullableUpdateSecurityGroupPayload) Get() *UpdateSecurityGroupPayload { - return v.value -} - -func (v *NullableUpdateSecurityGroupPayload) Set(val *UpdateSecurityGroupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateSecurityGroupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateSecurityGroupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateSecurityGroupPayload(val *UpdateSecurityGroupPayload) *NullableUpdateSecurityGroupPayload { - return &NullableUpdateSecurityGroupPayload{value: val, isSet: true} -} - -func (v NullableUpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateSecurityGroupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_security_group_payload_test.go b/services/iaasalpha/model_update_security_group_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_security_group_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_server_payload.go b/services/iaasalpha/model_update_server_payload.go deleted file mode 100644 index 0e6766ab7..000000000 --- a/services/iaasalpha/model_update_server_payload.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateServerPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateServerPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateServerPayloadGetLabelsArgType = map[string]interface{} -type UpdateServerPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateServerPayloadGetLabelsAttributeTypeOk(arg UpdateServerPayloadGetLabelsAttributeType) (ret UpdateServerPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLabelsAttributeType, val UpdateServerPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for metadata -*/ - -// isFreeform -type UpdateServerPayloadGetMetadataAttributeType = *map[string]interface{} -type UpdateServerPayloadGetMetadataArgType = map[string]interface{} -type UpdateServerPayloadGetMetadataRetType = map[string]interface{} - -func getUpdateServerPayloadGetMetadataAttributeTypeOk(arg UpdateServerPayloadGetMetadataAttributeType) (ret UpdateServerPayloadGetMetadataRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateServerPayloadGetMetadataAttributeType(arg *UpdateServerPayloadGetMetadataAttributeType, val UpdateServerPayloadGetMetadataRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateServerPayloadGetNameAttributeType = *string - -func getUpdateServerPayloadGetNameAttributeTypeOk(arg UpdateServerPayloadGetNameAttributeType) (ret UpdateServerPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateServerPayloadGetNameAttributeType(arg *UpdateServerPayloadGetNameAttributeType, val UpdateServerPayloadGetNameRetType) { - *arg = &val -} - -type UpdateServerPayloadGetNameArgType = string -type UpdateServerPayloadGetNameRetType = string - -// UpdateServerPayload Object that represents an update request body of a server. -type UpdateServerPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. - Metadata UpdateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` - // The name for a Server. - Name UpdateServerPayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewUpdateServerPayload instantiates a new UpdateServerPayload 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 NewUpdateServerPayload() *UpdateServerPayload { - this := UpdateServerPayload{} - return &this -} - -// NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload 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 NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { - this := UpdateServerPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateServerPayload) GetLabels() (res UpdateServerPayloadGetLabelsRetType) { - 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 *UpdateServerPayload) GetLabelsOk() (ret UpdateServerPayloadGetLabelsRetType, ok bool) { - return getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateServerPayload) 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 *UpdateServerPayload) SetLabels(v UpdateServerPayloadGetLabelsRetType) { - setUpdateServerPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *UpdateServerPayload) GetMetadata() (res UpdateServerPayloadGetMetadataRetType) { - res, _ = o.GetMetadataOk() - return -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateServerPayload) GetMetadataOk() (ret UpdateServerPayloadGetMetadataRetType, ok bool) { - return getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) -} - -// HasMetadata returns a boolean if a field has been set. -func (o *UpdateServerPayload) HasMetadata() bool { - _, ok := o.GetMetadataOk() - return ok -} - -// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. -func (o *UpdateServerPayload) SetMetadata(v UpdateServerPayloadGetMetadataRetType) { - setUpdateServerPayloadGetMetadataAttributeType(&o.Metadata, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) { - 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 *UpdateServerPayload) GetNameOk() (ret UpdateServerPayloadGetNameRetType, ok bool) { - return getUpdateServerPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateServerPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateServerPayload) SetName(v UpdateServerPayloadGetNameRetType) { - setUpdateServerPayloadGetNameAttributeType(&o.Name, v) -} - -func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata); ok { - toSerialize["Metadata"] = val - } - if val, ok := getUpdateServerPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableUpdateServerPayload struct { - value *UpdateServerPayload - isSet bool -} - -func (v NullableUpdateServerPayload) Get() *UpdateServerPayload { - return v.value -} - -func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateServerPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateServerPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload { - return &NullableUpdateServerPayload{value: val, isSet: true} -} - -func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_server_payload_test.go b/services/iaasalpha/model_update_server_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_server_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_snapshot_payload.go b/services/iaasalpha/model_update_snapshot_payload.go deleted file mode 100644 index 89c1bd407..000000000 --- a/services/iaasalpha/model_update_snapshot_payload.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateSnapshotPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateSnapshotPayloadGetLabelsArgType = map[string]interface{} -type UpdateSnapshotPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(arg UpdateSnapshotPayloadGetLabelsAttributeType) (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateSnapshotPayloadGetLabelsAttributeType(arg *UpdateSnapshotPayloadGetLabelsAttributeType, val UpdateSnapshotPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateSnapshotPayloadGetNameAttributeType = *string - -func getUpdateSnapshotPayloadGetNameAttributeTypeOk(arg UpdateSnapshotPayloadGetNameAttributeType) (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateSnapshotPayloadGetNameAttributeType(arg *UpdateSnapshotPayloadGetNameAttributeType, val UpdateSnapshotPayloadGetNameRetType) { - *arg = &val -} - -type UpdateSnapshotPayloadGetNameArgType = string -type UpdateSnapshotPayloadGetNameRetType = string - -// UpdateSnapshotPayload Object that represents an update request body of a snapshot. -type UpdateSnapshotPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewUpdateSnapshotPayload instantiates a new UpdateSnapshotPayload 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 NewUpdateSnapshotPayload() *UpdateSnapshotPayload { - this := UpdateSnapshotPayload{} - return &this -} - -// NewUpdateSnapshotPayloadWithDefaults instantiates a new UpdateSnapshotPayload 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 NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { - this := UpdateSnapshotPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateSnapshotPayload) GetLabels() (res UpdateSnapshotPayloadGetLabelsRetType) { - 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 *UpdateSnapshotPayload) GetLabelsOk() (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { - return getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateSnapshotPayload) 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 *UpdateSnapshotPayload) SetLabels(v UpdateSnapshotPayloadGetLabelsRetType) { - setUpdateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateSnapshotPayload) GetName() (res UpdateSnapshotPayloadGetNameRetType) { - 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 *UpdateSnapshotPayload) GetNameOk() (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { - return getUpdateSnapshotPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateSnapshotPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateSnapshotPayload) SetName(v UpdateSnapshotPayloadGetNameRetType) { - setUpdateSnapshotPayloadGetNameAttributeType(&o.Name, v) -} - -func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableUpdateSnapshotPayload struct { - value *UpdateSnapshotPayload - isSet bool -} - -func (v NullableUpdateSnapshotPayload) Get() *UpdateSnapshotPayload { - return v.value -} - -func (v *NullableUpdateSnapshotPayload) Set(val *UpdateSnapshotPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateSnapshotPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateSnapshotPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateSnapshotPayload(val *UpdateSnapshotPayload) *NullableUpdateSnapshotPayload { - return &NullableUpdateSnapshotPayload{value: val, isSet: true} -} - -func (v NullableUpdateSnapshotPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateSnapshotPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_snapshot_payload_test.go b/services/iaasalpha/model_update_snapshot_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_snapshot_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_virtual_ip_payload.go b/services/iaasalpha/model_update_virtual_ip_payload.go deleted file mode 100644 index 487dccbcb..000000000 --- a/services/iaasalpha/model_update_virtual_ip_payload.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateVirtualIPPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVirtualIPPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateVirtualIPPayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateVirtualIPPayloadGetLabelsArgType = map[string]interface{} -type UpdateVirtualIPPayloadGetLabelsRetType = map[string]interface{} - -func getUpdateVirtualIPPayloadGetLabelsAttributeTypeOk(arg UpdateVirtualIPPayloadGetLabelsAttributeType) (ret UpdateVirtualIPPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVirtualIPPayloadGetLabelsAttributeType(arg *UpdateVirtualIPPayloadGetLabelsAttributeType, val UpdateVirtualIPPayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for members -*/ - -// isArray -type UpdateVirtualIPPayloadGetMembersAttributeType = *[]string -type UpdateVirtualIPPayloadGetMembersArgType = *[]string -type UpdateVirtualIPPayloadGetMembersRetType = *[]string - -func getUpdateVirtualIPPayloadGetMembersAttributeTypeOk(arg UpdateVirtualIPPayloadGetMembersAttributeType) (ret UpdateVirtualIPPayloadGetMembersRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg, true -} - -func setUpdateVirtualIPPayloadGetMembersAttributeType(arg *UpdateVirtualIPPayloadGetMembersAttributeType, val UpdateVirtualIPPayloadGetMembersRetType) { - *arg = val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateVirtualIPPayloadGetNameAttributeType = *string - -func getUpdateVirtualIPPayloadGetNameAttributeTypeOk(arg UpdateVirtualIPPayloadGetNameAttributeType) (ret UpdateVirtualIPPayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVirtualIPPayloadGetNameAttributeType(arg *UpdateVirtualIPPayloadGetNameAttributeType, val UpdateVirtualIPPayloadGetNameRetType) { - *arg = &val -} - -type UpdateVirtualIPPayloadGetNameArgType = string -type UpdateVirtualIPPayloadGetNameRetType = string - -// UpdateVirtualIPPayload Object that represents a virtual IP update request body. -type UpdateVirtualIPPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateVirtualIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // A list of UUIDs. - Members UpdateVirtualIPPayloadGetMembersAttributeType `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateVirtualIPPayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewUpdateVirtualIPPayload instantiates a new UpdateVirtualIPPayload 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 NewUpdateVirtualIPPayload() *UpdateVirtualIPPayload { - this := UpdateVirtualIPPayload{} - return &this -} - -// NewUpdateVirtualIPPayloadWithDefaults instantiates a new UpdateVirtualIPPayload 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 NewUpdateVirtualIPPayloadWithDefaults() *UpdateVirtualIPPayload { - this := UpdateVirtualIPPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVirtualIPPayload) GetLabels() (res UpdateVirtualIPPayloadGetLabelsRetType) { - 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 *UpdateVirtualIPPayload) GetLabelsOk() (ret UpdateVirtualIPPayloadGetLabelsRetType, ok bool) { - return getUpdateVirtualIPPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateVirtualIPPayload) 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 *UpdateVirtualIPPayload) SetLabels(v UpdateVirtualIPPayloadGetLabelsRetType) { - setUpdateVirtualIPPayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetMembers returns the Members field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateVirtualIPPayload) GetMembers() (res UpdateVirtualIPPayloadGetMembersRetType) { - res, _ = o.GetMembersOk() - return -} - -// GetMembersOk returns a tuple with the Members 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 *UpdateVirtualIPPayload) GetMembersOk() (ret UpdateVirtualIPPayloadGetMembersRetType, ok bool) { - return getUpdateVirtualIPPayloadGetMembersAttributeTypeOk(o.Members) -} - -// HasMembers returns a boolean if a field has been set. -func (o *UpdateVirtualIPPayload) HasMembers() bool { - _, ok := o.GetMembersOk() - return ok -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *UpdateVirtualIPPayload) SetMembers(v UpdateVirtualIPPayloadGetMembersRetType) { - setUpdateVirtualIPPayloadGetMembersAttributeType(&o.Members, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateVirtualIPPayload) GetName() (res UpdateVirtualIPPayloadGetNameRetType) { - 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 *UpdateVirtualIPPayload) GetNameOk() (ret UpdateVirtualIPPayloadGetNameRetType, ok bool) { - return getUpdateVirtualIPPayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateVirtualIPPayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateVirtualIPPayload) SetName(v UpdateVirtualIPPayloadGetNameRetType) { - setUpdateVirtualIPPayloadGetNameAttributeType(&o.Name, v) -} - -func (o UpdateVirtualIPPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateVirtualIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateVirtualIPPayloadGetMembersAttributeTypeOk(o.Members); ok { - toSerialize["Members"] = val - } - if val, ok := getUpdateVirtualIPPayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableUpdateVirtualIPPayload struct { - value *UpdateVirtualIPPayload - isSet bool -} - -func (v NullableUpdateVirtualIPPayload) Get() *UpdateVirtualIPPayload { - return v.value -} - -func (v *NullableUpdateVirtualIPPayload) Set(val *UpdateVirtualIPPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVirtualIPPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVirtualIPPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVirtualIPPayload(val *UpdateVirtualIPPayload) *NullableUpdateVirtualIPPayload { - return &NullableUpdateVirtualIPPayload{value: val, isSet: true} -} - -func (v NullableUpdateVirtualIPPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVirtualIPPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_virtual_ip_payload_test.go b/services/iaasalpha/model_update_virtual_ip_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_virtual_ip_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_update_volume_payload.go b/services/iaasalpha/model_update_volume_payload.go deleted file mode 100644 index 1a4eedb7f..000000000 --- a/services/iaasalpha/model_update_volume_payload.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the UpdateVolumePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVolumePayload{} - -/* - types and functions for bootable -*/ - -// isBoolean -type UpdateVolumePayloadgetBootableAttributeType = *bool -type UpdateVolumePayloadgetBootableArgType = bool -type UpdateVolumePayloadgetBootableRetType = bool - -func getUpdateVolumePayloadgetBootableAttributeTypeOk(arg UpdateVolumePayloadgetBootableAttributeType) (ret UpdateVolumePayloadgetBootableRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVolumePayloadgetBootableAttributeType(arg *UpdateVolumePayloadgetBootableAttributeType, val UpdateVolumePayloadgetBootableRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -type UpdateVolumePayloadGetDescriptionAttributeType = *string - -func getUpdateVolumePayloadGetDescriptionAttributeTypeOk(arg UpdateVolumePayloadGetDescriptionAttributeType) (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVolumePayloadGetDescriptionAttributeType(arg *UpdateVolumePayloadGetDescriptionAttributeType, val UpdateVolumePayloadGetDescriptionRetType) { - *arg = &val -} - -type UpdateVolumePayloadGetDescriptionArgType = string -type UpdateVolumePayloadGetDescriptionRetType = string - -/* - types and functions for imageConfig -*/ - -// isModel -type UpdateVolumePayloadGetImageConfigAttributeType = *ImageConfig -type UpdateVolumePayloadGetImageConfigArgType = ImageConfig -type UpdateVolumePayloadGetImageConfigRetType = ImageConfig - -func getUpdateVolumePayloadGetImageConfigAttributeTypeOk(arg UpdateVolumePayloadGetImageConfigAttributeType) (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVolumePayloadGetImageConfigAttributeType(arg *UpdateVolumePayloadGetImageConfigAttributeType, val UpdateVolumePayloadGetImageConfigRetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type UpdateVolumePayloadGetLabelsAttributeType = *map[string]interface{} -type UpdateVolumePayloadGetLabelsArgType = map[string]interface{} -type UpdateVolumePayloadGetLabelsRetType = map[string]interface{} - -func getUpdateVolumePayloadGetLabelsAttributeTypeOk(arg UpdateVolumePayloadGetLabelsAttributeType) (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVolumePayloadGetLabelsAttributeType(arg *UpdateVolumePayloadGetLabelsAttributeType, val UpdateVolumePayloadGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type UpdateVolumePayloadGetNameAttributeType = *string - -func getUpdateVolumePayloadGetNameAttributeTypeOk(arg UpdateVolumePayloadGetNameAttributeType) (ret UpdateVolumePayloadGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUpdateVolumePayloadGetNameAttributeType(arg *UpdateVolumePayloadGetNameAttributeType, val UpdateVolumePayloadGetNameRetType) { - *arg = &val -} - -type UpdateVolumePayloadGetNameArgType = string -type UpdateVolumePayloadGetNameRetType = string - -// UpdateVolumePayload Object that represents an update request body of a volume. -type UpdateVolumePayload struct { - // Indicates if a volume is bootable. - Bootable UpdateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description UpdateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` - ImageConfig UpdateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels UpdateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name UpdateVolumePayloadGetNameAttributeType `json:"name,omitempty"` -} - -// NewUpdateVolumePayload instantiates a new UpdateVolumePayload 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 NewUpdateVolumePayload() *UpdateVolumePayload { - this := UpdateVolumePayload{} - return &this -} - -// NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload 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 NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { - this := UpdateVolumePayload{} - return &this -} - -// GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetBootable() (res UpdateVolumePayloadgetBootableRetType) { - res, _ = o.GetBootableOk() - return -} - -// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVolumePayload) GetBootableOk() (ret UpdateVolumePayloadgetBootableRetType, ok bool) { - return getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) -} - -// HasBootable returns a boolean if a field has been set. -func (o *UpdateVolumePayload) HasBootable() bool { - _, ok := o.GetBootableOk() - return ok -} - -// SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *UpdateVolumePayload) SetBootable(v UpdateVolumePayloadgetBootableRetType) { - setUpdateVolumePayloadgetBootableAttributeType(&o.Bootable, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetDescription() (res UpdateVolumePayloadGetDescriptionRetType) { - 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 *UpdateVolumePayload) GetDescriptionOk() (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { - return getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateVolumePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdateVolumePayload) SetDescription(v UpdateVolumePayloadGetDescriptionRetType) { - setUpdateVolumePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetImageConfig() (res UpdateVolumePayloadGetImageConfigRetType) { - res, _ = o.GetImageConfigOk() - return -} - -// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVolumePayload) GetImageConfigOk() (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { - return getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) -} - -// HasImageConfig returns a boolean if a field has been set. -func (o *UpdateVolumePayload) HasImageConfig() bool { - _, ok := o.GetImageConfigOk() - return ok -} - -// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *UpdateVolumePayload) SetImageConfig(v UpdateVolumePayloadGetImageConfigRetType) { - setUpdateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetLabels() (res UpdateVolumePayloadGetLabelsRetType) { - 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 *UpdateVolumePayload) GetLabelsOk() (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { - return getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateVolumePayload) 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 *UpdateVolumePayload) SetLabels(v UpdateVolumePayloadGetLabelsRetType) { - setUpdateVolumePayloadGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetName() (res UpdateVolumePayloadGetNameRetType) { - 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 *UpdateVolumePayload) GetNameOk() (ret UpdateVolumePayloadGetNameRetType, ok bool) { - return getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateVolumePayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateVolumePayload) SetName(v UpdateVolumePayloadGetNameRetType) { - setUpdateVolumePayloadGetNameAttributeType(&o.Name, v) -} - -func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { - toSerialize["Bootable"] = val - } - if val, ok := getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig); ok { - toSerialize["ImageConfig"] = val - } - if val, ok := getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - return toSerialize, nil -} - -type NullableUpdateVolumePayload struct { - value *UpdateVolumePayload - isSet bool -} - -func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { - return v.value -} - -func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVolumePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVolumePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { - return &NullableUpdateVolumePayload{value: val, isSet: true} -} - -func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_update_volume_payload_test.go b/services/iaasalpha/model_update_volume_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_update_volume_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go b/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go deleted file mode 100644 index fe4371b68..000000000 --- a/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the V1alpha1UpdateRouteOfAreaPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1alpha1UpdateRouteOfAreaPayload{} - -/* - types and functions for labels -*/ - -// isFreeform -type V1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType = *map[string]interface{} -type V1alpha1UpdateRouteOfAreaPayloadGetLabelsArgType = map[string]interface{} -type V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType = map[string]interface{} - -func getV1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeTypeOk(arg V1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType) (ret V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setV1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType(arg *V1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType, val V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType) { - *arg = &val -} - -// V1alpha1UpdateRouteOfAreaPayload Object that represents the request body for a route update. -type V1alpha1UpdateRouteOfAreaPayload struct { - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels V1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` -} - -// NewV1alpha1UpdateRouteOfAreaPayload instantiates a new V1alpha1UpdateRouteOfAreaPayload 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 NewV1alpha1UpdateRouteOfAreaPayload() *V1alpha1UpdateRouteOfAreaPayload { - this := V1alpha1UpdateRouteOfAreaPayload{} - return &this -} - -// NewV1alpha1UpdateRouteOfAreaPayloadWithDefaults instantiates a new V1alpha1UpdateRouteOfAreaPayload 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 NewV1alpha1UpdateRouteOfAreaPayloadWithDefaults() *V1alpha1UpdateRouteOfAreaPayload { - this := V1alpha1UpdateRouteOfAreaPayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *V1alpha1UpdateRouteOfAreaPayload) GetLabels() (res V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType) { - 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 *V1alpha1UpdateRouteOfAreaPayload) GetLabelsOk() (ret V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType, ok bool) { - return getV1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *V1alpha1UpdateRouteOfAreaPayload) 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 *V1alpha1UpdateRouteOfAreaPayload) SetLabels(v V1alpha1UpdateRouteOfAreaPayloadGetLabelsRetType) { - setV1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeType(&o.Labels, v) -} - -func (o V1alpha1UpdateRouteOfAreaPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getV1alpha1UpdateRouteOfAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - return toSerialize, nil -} - -type NullableV1alpha1UpdateRouteOfAreaPayload struct { - value *V1alpha1UpdateRouteOfAreaPayload - isSet bool -} - -func (v NullableV1alpha1UpdateRouteOfAreaPayload) Get() *V1alpha1UpdateRouteOfAreaPayload { - return v.value -} - -func (v *NullableV1alpha1UpdateRouteOfAreaPayload) Set(val *V1alpha1UpdateRouteOfAreaPayload) { - v.value = val - v.isSet = true -} - -func (v NullableV1alpha1UpdateRouteOfAreaPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableV1alpha1UpdateRouteOfAreaPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1alpha1UpdateRouteOfAreaPayload(val *V1alpha1UpdateRouteOfAreaPayload) *NullableV1alpha1UpdateRouteOfAreaPayload { - return &NullableV1alpha1UpdateRouteOfAreaPayload{value: val, isSet: true} -} - -func (v NullableV1alpha1UpdateRouteOfAreaPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1alpha1UpdateRouteOfAreaPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_v1alpha1_update_route_of_area_payload_test.go b/services/iaasalpha/model_v1alpha1_update_route_of_area_payload_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_v1alpha1_update_route_of_area_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_virtual_ip.go b/services/iaasalpha/model_virtual_ip.go deleted file mode 100644 index d116c0fa2..000000000 --- a/services/iaasalpha/model_virtual_ip.go +++ /dev/null @@ -1,421 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VirtualIp type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VirtualIp{} - -/* - types and functions for id -*/ - -// isNotNullableString -type VirtualIpGetIdAttributeType = *string - -func getVirtualIpGetIdAttributeTypeOk(arg VirtualIpGetIdAttributeType) (ret VirtualIpGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetIdAttributeType(arg *VirtualIpGetIdAttributeType, val VirtualIpGetIdRetType) { - *arg = &val -} - -type VirtualIpGetIdArgType = string -type VirtualIpGetIdRetType = string - -/* - types and functions for ip -*/ - -// isNotNullableString -type VirtualIpGetIpAttributeType = *string - -func getVirtualIpGetIpAttributeTypeOk(arg VirtualIpGetIpAttributeType) (ret VirtualIpGetIpRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetIpAttributeType(arg *VirtualIpGetIpAttributeType, val VirtualIpGetIpRetType) { - *arg = &val -} - -type VirtualIpGetIpArgType = string -type VirtualIpGetIpRetType = string - -/* - types and functions for labels -*/ - -// isFreeform -type VirtualIpGetLabelsAttributeType = *map[string]interface{} -type VirtualIpGetLabelsArgType = map[string]interface{} -type VirtualIpGetLabelsRetType = map[string]interface{} - -func getVirtualIpGetLabelsAttributeTypeOk(arg VirtualIpGetLabelsAttributeType) (ret VirtualIpGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetLabelsAttributeType(arg *VirtualIpGetLabelsAttributeType, val VirtualIpGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for members -*/ - -// isArray -type VirtualIpGetMembersAttributeType = *[]string -type VirtualIpGetMembersArgType = []string -type VirtualIpGetMembersRetType = []string - -func getVirtualIpGetMembersAttributeTypeOk(arg VirtualIpGetMembersAttributeType) (ret VirtualIpGetMembersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetMembersAttributeType(arg *VirtualIpGetMembersAttributeType, val VirtualIpGetMembersRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type VirtualIpGetNameAttributeType = *string - -func getVirtualIpGetNameAttributeTypeOk(arg VirtualIpGetNameAttributeType) (ret VirtualIpGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetNameAttributeType(arg *VirtualIpGetNameAttributeType, val VirtualIpGetNameRetType) { - *arg = &val -} - -type VirtualIpGetNameArgType = string -type VirtualIpGetNameRetType = string - -/* - types and functions for network -*/ - -// isNotNullableString -type VirtualIpGetNetworkAttributeType = *string - -func getVirtualIpGetNetworkAttributeTypeOk(arg VirtualIpGetNetworkAttributeType) (ret VirtualIpGetNetworkRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetNetworkAttributeType(arg *VirtualIpGetNetworkAttributeType, val VirtualIpGetNetworkRetType) { - *arg = &val -} - -type VirtualIpGetNetworkArgType = string -type VirtualIpGetNetworkRetType = string - -/* - types and functions for status -*/ - -// isNotNullableString -type VirtualIpGetStatusAttributeType = *string - -func getVirtualIpGetStatusAttributeTypeOk(arg VirtualIpGetStatusAttributeType) (ret VirtualIpGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpGetStatusAttributeType(arg *VirtualIpGetStatusAttributeType, val VirtualIpGetStatusRetType) { - *arg = &val -} - -type VirtualIpGetStatusArgType = string -type VirtualIpGetStatusRetType = string - -// VirtualIp Object that represents a virtual IP. -type VirtualIp struct { - // Universally Unique Identifier (UUID). - Id VirtualIpGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. - Ip VirtualIpGetIpAttributeType `json:"ip,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels VirtualIpGetLabelsAttributeType `json:"labels,omitempty"` - // A list of UUIDs. - Members VirtualIpGetMembersAttributeType `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name VirtualIpGetNameAttributeType `json:"name,omitempty"` - // Universally Unique Identifier (UUID). - Network VirtualIpGetNetworkAttributeType `json:"network,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status VirtualIpGetStatusAttributeType `json:"status,omitempty"` -} - -// NewVirtualIp instantiates a new VirtualIp 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 NewVirtualIp() *VirtualIp { - this := VirtualIp{} - return &this -} - -// NewVirtualIpWithDefaults instantiates a new VirtualIp 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 NewVirtualIpWithDefaults() *VirtualIp { - this := VirtualIp{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *VirtualIp) GetId() (res VirtualIpGetIdRetType) { - 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 *VirtualIp) GetIdOk() (ret VirtualIpGetIdRetType, ok bool) { - return getVirtualIpGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *VirtualIp) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *VirtualIp) SetId(v VirtualIpGetIdRetType) { - setVirtualIpGetIdAttributeType(&o.Id, v) -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *VirtualIp) GetIp() (res VirtualIpGetIpRetType) { - res, _ = o.GetIpOk() - return -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VirtualIp) GetIpOk() (ret VirtualIpGetIpRetType, ok bool) { - return getVirtualIpGetIpAttributeTypeOk(o.Ip) -} - -// HasIp returns a boolean if a field has been set. -func (o *VirtualIp) HasIp() bool { - _, ok := o.GetIpOk() - return ok -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *VirtualIp) SetIp(v VirtualIpGetIpRetType) { - setVirtualIpGetIpAttributeType(&o.Ip, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VirtualIp) GetLabels() (res VirtualIpGetLabelsRetType) { - 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 *VirtualIp) GetLabelsOk() (ret VirtualIpGetLabelsRetType, ok bool) { - return getVirtualIpGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *VirtualIp) 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 *VirtualIp) SetLabels(v VirtualIpGetLabelsRetType) { - setVirtualIpGetLabelsAttributeType(&o.Labels, v) -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *VirtualIp) GetMembers() (res VirtualIpGetMembersRetType) { - res, _ = o.GetMembersOk() - return -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VirtualIp) GetMembersOk() (ret VirtualIpGetMembersRetType, ok bool) { - return getVirtualIpGetMembersAttributeTypeOk(o.Members) -} - -// HasMembers returns a boolean if a field has been set. -func (o *VirtualIp) HasMembers() bool { - _, ok := o.GetMembersOk() - return ok -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *VirtualIp) SetMembers(v VirtualIpGetMembersRetType) { - setVirtualIpGetMembersAttributeType(&o.Members, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *VirtualIp) GetName() (res VirtualIpGetNameRetType) { - 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 *VirtualIp) GetNameOk() (ret VirtualIpGetNameRetType, ok bool) { - return getVirtualIpGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *VirtualIp) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *VirtualIp) SetName(v VirtualIpGetNameRetType) { - setVirtualIpGetNameAttributeType(&o.Name, v) -} - -// GetNetwork returns the Network field value if set, zero value otherwise. -func (o *VirtualIp) GetNetwork() (res VirtualIpGetNetworkRetType) { - res, _ = o.GetNetworkOk() - return -} - -// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VirtualIp) GetNetworkOk() (ret VirtualIpGetNetworkRetType, ok bool) { - return getVirtualIpGetNetworkAttributeTypeOk(o.Network) -} - -// HasNetwork returns a boolean if a field has been set. -func (o *VirtualIp) HasNetwork() bool { - _, ok := o.GetNetworkOk() - return ok -} - -// SetNetwork gets a reference to the given string and assigns it to the Network field. -func (o *VirtualIp) SetNetwork(v VirtualIpGetNetworkRetType) { - setVirtualIpGetNetworkAttributeType(&o.Network, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *VirtualIp) GetStatus() (res VirtualIpGetStatusRetType) { - 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 *VirtualIp) GetStatusOk() (ret VirtualIpGetStatusRetType, ok bool) { - return getVirtualIpGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *VirtualIp) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *VirtualIp) SetStatus(v VirtualIpGetStatusRetType) { - setVirtualIpGetStatusAttributeType(&o.Status, v) -} - -func (o VirtualIp) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVirtualIpGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getVirtualIpGetIpAttributeTypeOk(o.Ip); ok { - toSerialize["Ip"] = val - } - if val, ok := getVirtualIpGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getVirtualIpGetMembersAttributeTypeOk(o.Members); ok { - toSerialize["Members"] = val - } - if val, ok := getVirtualIpGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getVirtualIpGetNetworkAttributeTypeOk(o.Network); ok { - toSerialize["Network"] = val - } - if val, ok := getVirtualIpGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - return toSerialize, nil -} - -type NullableVirtualIp struct { - value *VirtualIp - isSet bool -} - -func (v NullableVirtualIp) Get() *VirtualIp { - return v.value -} - -func (v *NullableVirtualIp) Set(val *VirtualIp) { - v.value = val - v.isSet = true -} - -func (v NullableVirtualIp) IsSet() bool { - return v.isSet -} - -func (v *NullableVirtualIp) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVirtualIp(val *VirtualIp) *NullableVirtualIp { - return &NullableVirtualIp{value: val, isSet: true} -} - -func (v NullableVirtualIp) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVirtualIp) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_virtual_ip_list_response.go b/services/iaasalpha/model_virtual_ip_list_response.go deleted file mode 100644 index d762ea5ba..000000000 --- a/services/iaasalpha/model_virtual_ip_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VirtualIpListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VirtualIpListResponse{} - -/* - types and functions for items -*/ - -// isArray -type VirtualIpListResponseGetItemsAttributeType = *[]VirtualIp -type VirtualIpListResponseGetItemsArgType = []VirtualIp -type VirtualIpListResponseGetItemsRetType = []VirtualIp - -func getVirtualIpListResponseGetItemsAttributeTypeOk(arg VirtualIpListResponseGetItemsAttributeType) (ret VirtualIpListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVirtualIpListResponseGetItemsAttributeType(arg *VirtualIpListResponseGetItemsAttributeType, val VirtualIpListResponseGetItemsRetType) { - *arg = &val -} - -// VirtualIpListResponse Virtual IPs list response. -type VirtualIpListResponse struct { - // A list of virtual IPs. - // REQUIRED - Items VirtualIpListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _VirtualIpListResponse VirtualIpListResponse - -// NewVirtualIpListResponse instantiates a new VirtualIpListResponse 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 NewVirtualIpListResponse(items VirtualIpListResponseGetItemsArgType) *VirtualIpListResponse { - this := VirtualIpListResponse{} - setVirtualIpListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewVirtualIpListResponseWithDefaults instantiates a new VirtualIpListResponse 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 NewVirtualIpListResponseWithDefaults() *VirtualIpListResponse { - this := VirtualIpListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *VirtualIpListResponse) GetItems() (ret VirtualIpListResponseGetItemsRetType) { - 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 *VirtualIpListResponse) GetItemsOk() (ret VirtualIpListResponseGetItemsRetType, ok bool) { - return getVirtualIpListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *VirtualIpListResponse) SetItems(v VirtualIpListResponseGetItemsRetType) { - setVirtualIpListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o VirtualIpListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVirtualIpListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableVirtualIpListResponse struct { - value *VirtualIpListResponse - isSet bool -} - -func (v NullableVirtualIpListResponse) Get() *VirtualIpListResponse { - return v.value -} - -func (v *NullableVirtualIpListResponse) Set(val *VirtualIpListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableVirtualIpListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableVirtualIpListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVirtualIpListResponse(val *VirtualIpListResponse) *NullableVirtualIpListResponse { - return &NullableVirtualIpListResponse{value: val, isSet: true} -} - -func (v NullableVirtualIpListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVirtualIpListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_virtual_ip_list_response_test.go b/services/iaasalpha/model_virtual_ip_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_virtual_ip_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_virtual_ip_test.go b/services/iaasalpha/model_virtual_ip_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_virtual_ip_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume.go b/services/iaasalpha/model_volume.go deleted file mode 100644 index 28aac32d7..000000000 --- a/services/iaasalpha/model_volume.go +++ /dev/null @@ -1,756 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" - "time" -) - -// checks if the Volume type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Volume{} - -/* - types and functions for availabilityZone -*/ - -// isNotNullableString -type VolumeGetAvailabilityZoneAttributeType = *string - -func getVolumeGetAvailabilityZoneAttributeTypeOk(arg VolumeGetAvailabilityZoneAttributeType) (ret VolumeGetAvailabilityZoneRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetAvailabilityZoneAttributeType(arg *VolumeGetAvailabilityZoneAttributeType, val VolumeGetAvailabilityZoneRetType) { - *arg = &val -} - -type VolumeGetAvailabilityZoneArgType = string -type VolumeGetAvailabilityZoneRetType = string - -/* - types and functions for bootable -*/ - -// isBoolean -type VolumegetBootableAttributeType = *bool -type VolumegetBootableArgType = bool -type VolumegetBootableRetType = bool - -func getVolumegetBootableAttributeTypeOk(arg VolumegetBootableAttributeType) (ret VolumegetBootableRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumegetBootableAttributeType(arg *VolumegetBootableAttributeType, val VolumegetBootableRetType) { - *arg = &val -} - -/* - types and functions for createdAt -*/ - -// isDateTime -type VolumeGetCreatedAtAttributeType = *time.Time -type VolumeGetCreatedAtArgType = time.Time -type VolumeGetCreatedAtRetType = time.Time - -func getVolumeGetCreatedAtAttributeTypeOk(arg VolumeGetCreatedAtAttributeType) (ret VolumeGetCreatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetCreatedAtAttributeType(arg *VolumeGetCreatedAtAttributeType, val VolumeGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -type VolumeGetDescriptionAttributeType = *string - -func getVolumeGetDescriptionAttributeTypeOk(arg VolumeGetDescriptionAttributeType) (ret VolumeGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetDescriptionAttributeType(arg *VolumeGetDescriptionAttributeType, val VolumeGetDescriptionRetType) { - *arg = &val -} - -type VolumeGetDescriptionArgType = string -type VolumeGetDescriptionRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type VolumeGetIdAttributeType = *string - -func getVolumeGetIdAttributeTypeOk(arg VolumeGetIdAttributeType) (ret VolumeGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetIdAttributeType(arg *VolumeGetIdAttributeType, val VolumeGetIdRetType) { - *arg = &val -} - -type VolumeGetIdArgType = string -type VolumeGetIdRetType = string - -/* - types and functions for imageConfig -*/ - -// isModel -type VolumeGetImageConfigAttributeType = *ImageConfig -type VolumeGetImageConfigArgType = ImageConfig -type VolumeGetImageConfigRetType = ImageConfig - -func getVolumeGetImageConfigAttributeTypeOk(arg VolumeGetImageConfigAttributeType) (ret VolumeGetImageConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetImageConfigAttributeType(arg *VolumeGetImageConfigAttributeType, val VolumeGetImageConfigRetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type VolumeGetLabelsAttributeType = *map[string]interface{} -type VolumeGetLabelsArgType = map[string]interface{} -type VolumeGetLabelsRetType = map[string]interface{} - -func getVolumeGetLabelsAttributeTypeOk(arg VolumeGetLabelsAttributeType) (ret VolumeGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetLabelsAttributeType(arg *VolumeGetLabelsAttributeType, val VolumeGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type VolumeGetNameAttributeType = *string - -func getVolumeGetNameAttributeTypeOk(arg VolumeGetNameAttributeType) (ret VolumeGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetNameAttributeType(arg *VolumeGetNameAttributeType, val VolumeGetNameRetType) { - *arg = &val -} - -type VolumeGetNameArgType = string -type VolumeGetNameRetType = string - -/* - types and functions for performanceClass -*/ - -// isNotNullableString -type VolumeGetPerformanceClassAttributeType = *string - -func getVolumeGetPerformanceClassAttributeTypeOk(arg VolumeGetPerformanceClassAttributeType) (ret VolumeGetPerformanceClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetPerformanceClassAttributeType(arg *VolumeGetPerformanceClassAttributeType, val VolumeGetPerformanceClassRetType) { - *arg = &val -} - -type VolumeGetPerformanceClassArgType = string -type VolumeGetPerformanceClassRetType = string - -/* - types and functions for serverId -*/ - -// isNotNullableString -type VolumeGetServerIdAttributeType = *string - -func getVolumeGetServerIdAttributeTypeOk(arg VolumeGetServerIdAttributeType) (ret VolumeGetServerIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetServerIdAttributeType(arg *VolumeGetServerIdAttributeType, val VolumeGetServerIdRetType) { - *arg = &val -} - -type VolumeGetServerIdArgType = string -type VolumeGetServerIdRetType = string - -/* - types and functions for size -*/ - -// isLong -type VolumeGetSizeAttributeType = *int64 -type VolumeGetSizeArgType = int64 -type VolumeGetSizeRetType = int64 - -func getVolumeGetSizeAttributeTypeOk(arg VolumeGetSizeAttributeType) (ret VolumeGetSizeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetSizeAttributeType(arg *VolumeGetSizeAttributeType, val VolumeGetSizeRetType) { - *arg = &val -} - -/* - types and functions for source -*/ - -// isModel -type VolumeGetSourceAttributeType = *VolumeSource -type VolumeGetSourceArgType = VolumeSource -type VolumeGetSourceRetType = VolumeSource - -func getVolumeGetSourceAttributeTypeOk(arg VolumeGetSourceAttributeType) (ret VolumeGetSourceRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetSourceAttributeType(arg *VolumeGetSourceAttributeType, val VolumeGetSourceRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -type VolumeGetStatusAttributeType = *string - -func getVolumeGetStatusAttributeTypeOk(arg VolumeGetStatusAttributeType) (ret VolumeGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetStatusAttributeType(arg *VolumeGetStatusAttributeType, val VolumeGetStatusRetType) { - *arg = &val -} - -type VolumeGetStatusArgType = string -type VolumeGetStatusRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -type VolumeGetUpdatedAtAttributeType = *time.Time -type VolumeGetUpdatedAtArgType = time.Time -type VolumeGetUpdatedAtRetType = time.Time - -func getVolumeGetUpdatedAtAttributeTypeOk(arg VolumeGetUpdatedAtAttributeType) (ret VolumeGetUpdatedAtRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeGetUpdatedAtAttributeType(arg *VolumeGetUpdatedAtAttributeType, val VolumeGetUpdatedAtRetType) { - *arg = &val -} - -// Volume Object that represents a volume and its parameters. Used for Creating and returning (get/list). -type Volume struct { - // Object that represents an availability zone. - // REQUIRED - AvailabilityZone VolumeGetAvailabilityZoneAttributeType `json:"availabilityZone" required:"true"` - // Indicates if a volume is bootable. - Bootable VolumegetBootableAttributeType `json:"bootable,omitempty"` - // Date-time when resource was created. - CreatedAt VolumeGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description VolumeGetDescriptionAttributeType `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id VolumeGetIdAttributeType `json:"id,omitempty"` - ImageConfig VolumeGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels VolumeGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name VolumeGetNameAttributeType `json:"name,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass VolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` - // Universally Unique Identifier (UUID). - ServerId VolumeGetServerIdAttributeType `json:"serverId,omitempty"` - // Size in Gigabyte. - Size VolumeGetSizeAttributeType `json:"size,omitempty"` - Source VolumeGetSourceAttributeType `json:"source,omitempty"` - // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. - Status VolumeGetStatusAttributeType `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt VolumeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` -} - -type _Volume Volume - -// NewVolume instantiates a new Volume 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 NewVolume(availabilityZone VolumeGetAvailabilityZoneArgType) *Volume { - this := Volume{} - setVolumeGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) - return &this -} - -// NewVolumeWithDefaults instantiates a new Volume 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 NewVolumeWithDefaults() *Volume { - this := Volume{} - return &this -} - -// GetAvailabilityZone returns the AvailabilityZone field value -func (o *Volume) GetAvailabilityZone() (ret VolumeGetAvailabilityZoneRetType) { - ret, _ = o.GetAvailabilityZoneOk() - return ret -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value -// and a boolean to check if the value has been set. -func (o *Volume) GetAvailabilityZoneOk() (ret VolumeGetAvailabilityZoneRetType, ok bool) { - return getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) -} - -// SetAvailabilityZone sets field value -func (o *Volume) SetAvailabilityZone(v VolumeGetAvailabilityZoneRetType) { - setVolumeGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) -} - -// GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *Volume) GetBootable() (res VolumegetBootableRetType) { - res, _ = o.GetBootableOk() - return -} - -// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Volume) GetBootableOk() (ret VolumegetBootableRetType, ok bool) { - return getVolumegetBootableAttributeTypeOk(o.Bootable) -} - -// HasBootable returns a boolean if a field has been set. -func (o *Volume) HasBootable() bool { - _, ok := o.GetBootableOk() - return ok -} - -// SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *Volume) SetBootable(v VolumegetBootableRetType) { - setVolumegetBootableAttributeType(&o.Bootable, v) -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Volume) GetCreatedAt() (res VolumeGetCreatedAtRetType) { - 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 *Volume) GetCreatedAtOk() (ret VolumeGetCreatedAtRetType, ok bool) { - return getVolumeGetCreatedAtAttributeTypeOk(o.CreatedAt) -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Volume) 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 *Volume) SetCreatedAt(v VolumeGetCreatedAtRetType) { - setVolumeGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *Volume) GetDescription() (res VolumeGetDescriptionRetType) { - 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 *Volume) GetDescriptionOk() (ret VolumeGetDescriptionRetType, ok bool) { - return getVolumeGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *Volume) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Volume) SetDescription(v VolumeGetDescriptionRetType) { - setVolumeGetDescriptionAttributeType(&o.Description, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Volume) GetId() (res VolumeGetIdRetType) { - 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 *Volume) GetIdOk() (ret VolumeGetIdRetType, ok bool) { - return getVolumeGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -func (o *Volume) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Volume) SetId(v VolumeGetIdRetType) { - setVolumeGetIdAttributeType(&o.Id, v) -} - -// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *Volume) GetImageConfig() (res VolumeGetImageConfigRetType) { - res, _ = o.GetImageConfigOk() - return -} - -// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Volume) GetImageConfigOk() (ret VolumeGetImageConfigRetType, ok bool) { - return getVolumeGetImageConfigAttributeTypeOk(o.ImageConfig) -} - -// HasImageConfig returns a boolean if a field has been set. -func (o *Volume) HasImageConfig() bool { - _, ok := o.GetImageConfigOk() - return ok -} - -// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *Volume) SetImageConfig(v VolumeGetImageConfigRetType) { - setVolumeGetImageConfigAttributeType(&o.ImageConfig, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Volume) GetLabels() (res VolumeGetLabelsRetType) { - 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 *Volume) GetLabelsOk() (ret VolumeGetLabelsRetType, ok bool) { - return getVolumeGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *Volume) 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 *Volume) SetLabels(v VolumeGetLabelsRetType) { - setVolumeGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Volume) GetName() (res VolumeGetNameRetType) { - 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 *Volume) GetNameOk() (ret VolumeGetNameRetType, ok bool) { - return getVolumeGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -func (o *Volume) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Volume) SetName(v VolumeGetNameRetType) { - setVolumeGetNameAttributeType(&o.Name, v) -} - -// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *Volume) GetPerformanceClass() (res VolumeGetPerformanceClassRetType) { - 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 *Volume) GetPerformanceClassOk() (ret VolumeGetPerformanceClassRetType, ok bool) { - return getVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) -} - -// HasPerformanceClass returns a boolean if a field has been set. -func (o *Volume) HasPerformanceClass() bool { - _, ok := o.GetPerformanceClassOk() - return ok -} - -// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *Volume) SetPerformanceClass(v VolumeGetPerformanceClassRetType) { - setVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) -} - -// GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *Volume) GetServerId() (res VolumeGetServerIdRetType) { - res, _ = o.GetServerIdOk() - return -} - -// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Volume) GetServerIdOk() (ret VolumeGetServerIdRetType, ok bool) { - return getVolumeGetServerIdAttributeTypeOk(o.ServerId) -} - -// HasServerId returns a boolean if a field has been set. -func (o *Volume) HasServerId() bool { - _, ok := o.GetServerIdOk() - return ok -} - -// SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *Volume) SetServerId(v VolumeGetServerIdRetType) { - setVolumeGetServerIdAttributeType(&o.ServerId, v) -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *Volume) GetSize() (res VolumeGetSizeRetType) { - 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 *Volume) GetSizeOk() (ret VolumeGetSizeRetType, ok bool) { - return getVolumeGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -func (o *Volume) HasSize() bool { - _, ok := o.GetSizeOk() - return ok -} - -// SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Volume) SetSize(v VolumeGetSizeRetType) { - setVolumeGetSizeAttributeType(&o.Size, v) -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *Volume) GetSource() (res VolumeGetSourceRetType) { - 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 *Volume) GetSourceOk() (ret VolumeGetSourceRetType, ok bool) { - return getVolumeGetSourceAttributeTypeOk(o.Source) -} - -// HasSource returns a boolean if a field has been set. -func (o *Volume) HasSource() bool { - _, ok := o.GetSourceOk() - return ok -} - -// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. -func (o *Volume) SetSource(v VolumeGetSourceRetType) { - setVolumeGetSourceAttributeType(&o.Source, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Volume) GetStatus() (res VolumeGetStatusRetType) { - 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 *Volume) GetStatusOk() (ret VolumeGetStatusRetType, ok bool) { - return getVolumeGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -func (o *Volume) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Volume) SetStatus(v VolumeGetStatusRetType) { - setVolumeGetStatusAttributeType(&o.Status, v) -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Volume) GetUpdatedAt() (res VolumeGetUpdatedAtRetType) { - 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 *Volume) GetUpdatedAtOk() (ret VolumeGetUpdatedAtRetType, ok bool) { - return getVolumeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Volume) 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 *Volume) SetUpdatedAt(v VolumeGetUpdatedAtRetType) { - setVolumeGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -func (o Volume) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { - toSerialize["AvailabilityZone"] = val - } - if val, ok := getVolumegetBootableAttributeTypeOk(o.Bootable); ok { - toSerialize["Bootable"] = val - } - if val, ok := getVolumeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getVolumeGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getVolumeGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getVolumeGetImageConfigAttributeTypeOk(o.ImageConfig); ok { - toSerialize["ImageConfig"] = val - } - if val, ok := getVolumeGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getVolumeGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { - toSerialize["PerformanceClass"] = val - } - if val, ok := getVolumeGetServerIdAttributeTypeOk(o.ServerId); ok { - toSerialize["ServerId"] = val - } - if val, ok := getVolumeGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val - } - if val, ok := getVolumeGetSourceAttributeTypeOk(o.Source); ok { - toSerialize["Source"] = val - } - if val, ok := getVolumeGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getVolumeGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - return toSerialize, nil -} - -type NullableVolume struct { - value *Volume - isSet bool -} - -func (v NullableVolume) Get() *Volume { - return v.value -} - -func (v *NullableVolume) Set(val *Volume) { - v.value = val - v.isSet = true -} - -func (v NullableVolume) IsSet() bool { - return v.isSet -} - -func (v *NullableVolume) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolume(val *Volume) *NullableVolume { - return &NullableVolume{value: val, isSet: true} -} - -func (v NullableVolume) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolume) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_attachment.go b/services/iaasalpha/model_volume_attachment.go deleted file mode 100644 index f3cc28a54..000000000 --- a/services/iaasalpha/model_volume_attachment.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumeAttachment type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumeAttachment{} - -/* - types and functions for deleteOnTermination -*/ - -// isBoolean -type VolumeAttachmentgetDeleteOnTerminationAttributeType = *bool -type VolumeAttachmentgetDeleteOnTerminationArgType = bool -type VolumeAttachmentgetDeleteOnTerminationRetType = bool - -func getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(arg VolumeAttachmentgetDeleteOnTerminationAttributeType) (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeAttachmentgetDeleteOnTerminationAttributeType(arg *VolumeAttachmentgetDeleteOnTerminationAttributeType, val VolumeAttachmentgetDeleteOnTerminationRetType) { - *arg = &val -} - -/* - types and functions for serverId -*/ - -// isNotNullableString -type VolumeAttachmentGetServerIdAttributeType = *string - -func getVolumeAttachmentGetServerIdAttributeTypeOk(arg VolumeAttachmentGetServerIdAttributeType) (ret VolumeAttachmentGetServerIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeAttachmentGetServerIdAttributeType(arg *VolumeAttachmentGetServerIdAttributeType, val VolumeAttachmentGetServerIdRetType) { - *arg = &val -} - -type VolumeAttachmentGetServerIdArgType = string -type VolumeAttachmentGetServerIdRetType = string - -/* - types and functions for volumeId -*/ - -// isNotNullableString -type VolumeAttachmentGetVolumeIdAttributeType = *string - -func getVolumeAttachmentGetVolumeIdAttributeTypeOk(arg VolumeAttachmentGetVolumeIdAttributeType) (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeAttachmentGetVolumeIdAttributeType(arg *VolumeAttachmentGetVolumeIdAttributeType, val VolumeAttachmentGetVolumeIdRetType) { - *arg = &val -} - -type VolumeAttachmentGetVolumeIdArgType = string -type VolumeAttachmentGetVolumeIdRetType = string - -// VolumeAttachment Object that represents a Volume attachment to a server. -type VolumeAttachment struct { - // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination VolumeAttachmentgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` - // Universally Unique Identifier (UUID). - ServerId VolumeAttachmentGetServerIdAttributeType `json:"serverId,omitempty"` - // Universally Unique Identifier (UUID). - VolumeId VolumeAttachmentGetVolumeIdAttributeType `json:"volumeId,omitempty"` -} - -// NewVolumeAttachment instantiates a new VolumeAttachment 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 NewVolumeAttachment() *VolumeAttachment { - this := VolumeAttachment{} - return &this -} - -// NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment 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 NewVolumeAttachmentWithDefaults() *VolumeAttachment { - this := VolumeAttachment{} - return &this -} - -// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *VolumeAttachment) GetDeleteOnTermination() (res VolumeAttachmentgetDeleteOnTerminationRetType) { - 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 *VolumeAttachment) GetDeleteOnTerminationOk() (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { - return getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) -} - -// HasDeleteOnTermination returns a boolean if a field has been set. -func (o *VolumeAttachment) HasDeleteOnTermination() bool { - _, ok := o.GetDeleteOnTerminationOk() - return ok -} - -// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *VolumeAttachment) SetDeleteOnTermination(v VolumeAttachmentgetDeleteOnTerminationRetType) { - setVolumeAttachmentgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) -} - -// GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *VolumeAttachment) GetServerId() (res VolumeAttachmentGetServerIdRetType) { - res, _ = o.GetServerIdOk() - return -} - -// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VolumeAttachment) GetServerIdOk() (ret VolumeAttachmentGetServerIdRetType, ok bool) { - return getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId) -} - -// HasServerId returns a boolean if a field has been set. -func (o *VolumeAttachment) HasServerId() bool { - _, ok := o.GetServerIdOk() - return ok -} - -// SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *VolumeAttachment) SetServerId(v VolumeAttachmentGetServerIdRetType) { - setVolumeAttachmentGetServerIdAttributeType(&o.ServerId, v) -} - -// GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *VolumeAttachment) GetVolumeId() (res VolumeAttachmentGetVolumeIdRetType) { - res, _ = o.GetVolumeIdOk() - return -} - -// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VolumeAttachment) GetVolumeIdOk() (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { - return getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId) -} - -// HasVolumeId returns a boolean if a field has been set. -func (o *VolumeAttachment) HasVolumeId() bool { - _, ok := o.GetVolumeIdOk() - return ok -} - -// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *VolumeAttachment) SetVolumeId(v VolumeAttachmentGetVolumeIdRetType) { - setVolumeAttachmentGetVolumeIdAttributeType(&o.VolumeId, v) -} - -func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { - toSerialize["DeleteOnTermination"] = val - } - if val, ok := getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId); ok { - toSerialize["ServerId"] = val - } - if val, ok := getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId); ok { - toSerialize["VolumeId"] = val - } - return toSerialize, nil -} - -type NullableVolumeAttachment struct { - value *VolumeAttachment - isSet bool -} - -func (v NullableVolumeAttachment) Get() *VolumeAttachment { - return v.value -} - -func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) { - v.value = val - v.isSet = true -} - -func (v NullableVolumeAttachment) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumeAttachment) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment { - return &NullableVolumeAttachment{value: val, isSet: true} -} - -func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_attachment_list_response.go b/services/iaasalpha/model_volume_attachment_list_response.go deleted file mode 100644 index cb8e6b8f4..000000000 --- a/services/iaasalpha/model_volume_attachment_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumeAttachmentListResponse{} - -/* - types and functions for items -*/ - -// isArray -type VolumeAttachmentListResponseGetItemsAttributeType = *[]VolumeAttachment -type VolumeAttachmentListResponseGetItemsArgType = []VolumeAttachment -type VolumeAttachmentListResponseGetItemsRetType = []VolumeAttachment - -func getVolumeAttachmentListResponseGetItemsAttributeTypeOk(arg VolumeAttachmentListResponseGetItemsAttributeType) (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeAttachmentListResponseGetItemsAttributeType(arg *VolumeAttachmentListResponseGetItemsAttributeType, val VolumeAttachmentListResponseGetItemsRetType) { - *arg = &val -} - -// VolumeAttachmentListResponse Volume attachment list response. -type VolumeAttachmentListResponse struct { - // A list containing Volume attachments of a server. - // REQUIRED - Items VolumeAttachmentListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _VolumeAttachmentListResponse VolumeAttachmentListResponse - -// NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse 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 NewVolumeAttachmentListResponse(items VolumeAttachmentListResponseGetItemsArgType) *VolumeAttachmentListResponse { - this := VolumeAttachmentListResponse{} - setVolumeAttachmentListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse 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 NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { - this := VolumeAttachmentListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *VolumeAttachmentListResponse) GetItems() (ret VolumeAttachmentListResponseGetItemsRetType) { - 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 *VolumeAttachmentListResponse) GetItemsOk() (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { - return getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *VolumeAttachmentListResponse) SetItems(v VolumeAttachmentListResponseGetItemsRetType) { - setVolumeAttachmentListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableVolumeAttachmentListResponse struct { - value *VolumeAttachmentListResponse - isSet bool -} - -func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { - return v.value -} - -func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableVolumeAttachmentListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumeAttachmentListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { - return &NullableVolumeAttachmentListResponse{value: val, isSet: true} -} - -func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_attachment_list_response_test.go b/services/iaasalpha/model_volume_attachment_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_attachment_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_attachment_test.go b/services/iaasalpha/model_volume_attachment_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_attachment_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_list_response.go b/services/iaasalpha/model_volume_list_response.go deleted file mode 100644 index 5a9fb7833..000000000 --- a/services/iaasalpha/model_volume_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumeListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumeListResponse{} - -/* - types and functions for items -*/ - -// isArray -type VolumeListResponseGetItemsAttributeType = *[]Volume -type VolumeListResponseGetItemsArgType = []Volume -type VolumeListResponseGetItemsRetType = []Volume - -func getVolumeListResponseGetItemsAttributeTypeOk(arg VolumeListResponseGetItemsAttributeType) (ret VolumeListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeListResponseGetItemsAttributeType(arg *VolumeListResponseGetItemsAttributeType, val VolumeListResponseGetItemsRetType) { - *arg = &val -} - -// VolumeListResponse Volume list response. -type VolumeListResponse struct { - // A list containing volume objects. - // REQUIRED - Items VolumeListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _VolumeListResponse VolumeListResponse - -// NewVolumeListResponse instantiates a new VolumeListResponse 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 NewVolumeListResponse(items VolumeListResponseGetItemsArgType) *VolumeListResponse { - this := VolumeListResponse{} - setVolumeListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewVolumeListResponseWithDefaults instantiates a new VolumeListResponse 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 NewVolumeListResponseWithDefaults() *VolumeListResponse { - this := VolumeListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *VolumeListResponse) GetItems() (ret VolumeListResponseGetItemsRetType) { - 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 *VolumeListResponse) GetItemsOk() (ret VolumeListResponseGetItemsRetType, ok bool) { - return getVolumeListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *VolumeListResponse) SetItems(v VolumeListResponseGetItemsRetType) { - setVolumeListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumeListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableVolumeListResponse struct { - value *VolumeListResponse - isSet bool -} - -func (v NullableVolumeListResponse) Get() *VolumeListResponse { - return v.value -} - -func (v *NullableVolumeListResponse) Set(val *VolumeListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableVolumeListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumeListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumeListResponse(val *VolumeListResponse) *NullableVolumeListResponse { - return &NullableVolumeListResponse{value: val, isSet: true} -} - -func (v NullableVolumeListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumeListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_list_response_test.go b/services/iaasalpha/model_volume_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_performance_class.go b/services/iaasalpha/model_volume_performance_class.go deleted file mode 100644 index 944815764..000000000 --- a/services/iaasalpha/model_volume_performance_class.go +++ /dev/null @@ -1,320 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumePerformanceClass type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumePerformanceClass{} - -/* - types and functions for description -*/ - -// isNotNullableString -type VolumePerformanceClassGetDescriptionAttributeType = *string - -func getVolumePerformanceClassGetDescriptionAttributeTypeOk(arg VolumePerformanceClassGetDescriptionAttributeType) (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassGetDescriptionAttributeType(arg *VolumePerformanceClassGetDescriptionAttributeType, val VolumePerformanceClassGetDescriptionRetType) { - *arg = &val -} - -type VolumePerformanceClassGetDescriptionArgType = string -type VolumePerformanceClassGetDescriptionRetType = string - -/* - types and functions for iops -*/ - -// isLong -type VolumePerformanceClassGetIopsAttributeType = *int64 -type VolumePerformanceClassGetIopsArgType = int64 -type VolumePerformanceClassGetIopsRetType = int64 - -func getVolumePerformanceClassGetIopsAttributeTypeOk(arg VolumePerformanceClassGetIopsAttributeType) (ret VolumePerformanceClassGetIopsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassGetIopsAttributeType(arg *VolumePerformanceClassGetIopsAttributeType, val VolumePerformanceClassGetIopsRetType) { - *arg = &val -} - -/* - types and functions for labels -*/ - -// isFreeform -type VolumePerformanceClassGetLabelsAttributeType = *map[string]interface{} -type VolumePerformanceClassGetLabelsArgType = map[string]interface{} -type VolumePerformanceClassGetLabelsRetType = map[string]interface{} - -func getVolumePerformanceClassGetLabelsAttributeTypeOk(arg VolumePerformanceClassGetLabelsAttributeType) (ret VolumePerformanceClassGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassGetLabelsAttributeType(arg *VolumePerformanceClassGetLabelsAttributeType, val VolumePerformanceClassGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name -*/ - -// isNotNullableString -type VolumePerformanceClassGetNameAttributeType = *string - -func getVolumePerformanceClassGetNameAttributeTypeOk(arg VolumePerformanceClassGetNameAttributeType) (ret VolumePerformanceClassGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassGetNameAttributeType(arg *VolumePerformanceClassGetNameAttributeType, val VolumePerformanceClassGetNameRetType) { - *arg = &val -} - -type VolumePerformanceClassGetNameArgType = string -type VolumePerformanceClassGetNameRetType = string - -/* - types and functions for throughput -*/ - -// isLong -type VolumePerformanceClassGetThroughputAttributeType = *int64 -type VolumePerformanceClassGetThroughputArgType = int64 -type VolumePerformanceClassGetThroughputRetType = int64 - -func getVolumePerformanceClassGetThroughputAttributeTypeOk(arg VolumePerformanceClassGetThroughputAttributeType) (ret VolumePerformanceClassGetThroughputRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassGetThroughputAttributeType(arg *VolumePerformanceClassGetThroughputAttributeType, val VolumePerformanceClassGetThroughputRetType) { - *arg = &val -} - -// VolumePerformanceClass Object that represents a Volume performance class. -type VolumePerformanceClass struct { - // Description Object. Allows string up to 255 Characters. - Description VolumePerformanceClassGetDescriptionAttributeType `json:"description,omitempty"` - // Input/Output Operations per second. - Iops VolumePerformanceClassGetIopsAttributeType `json:"iops,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels VolumePerformanceClassGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name VolumePerformanceClassGetNameAttributeType `json:"name" required:"true"` - // Throughput in Megabyte per second. - Throughput VolumePerformanceClassGetThroughputAttributeType `json:"throughput,omitempty"` -} - -type _VolumePerformanceClass VolumePerformanceClass - -// NewVolumePerformanceClass instantiates a new VolumePerformanceClass 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 NewVolumePerformanceClass(name VolumePerformanceClassGetNameArgType) *VolumePerformanceClass { - this := VolumePerformanceClass{} - setVolumePerformanceClassGetNameAttributeType(&this.Name, name) - return &this -} - -// NewVolumePerformanceClassWithDefaults instantiates a new VolumePerformanceClass 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 NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { - this := VolumePerformanceClass{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetDescription() (res VolumePerformanceClassGetDescriptionRetType) { - 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 *VolumePerformanceClass) GetDescriptionOk() (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { - return getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -func (o *VolumePerformanceClass) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *VolumePerformanceClass) SetDescription(v VolumePerformanceClassGetDescriptionRetType) { - setVolumePerformanceClassGetDescriptionAttributeType(&o.Description, v) -} - -// GetIops returns the Iops field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetIops() (res VolumePerformanceClassGetIopsRetType) { - res, _ = o.GetIopsOk() - return -} - -// GetIopsOk returns a tuple with the Iops field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VolumePerformanceClass) GetIopsOk() (ret VolumePerformanceClassGetIopsRetType, ok bool) { - return getVolumePerformanceClassGetIopsAttributeTypeOk(o.Iops) -} - -// HasIops returns a boolean if a field has been set. -func (o *VolumePerformanceClass) HasIops() bool { - _, ok := o.GetIopsOk() - return ok -} - -// SetIops gets a reference to the given int64 and assigns it to the Iops field. -func (o *VolumePerformanceClass) SetIops(v VolumePerformanceClassGetIopsRetType) { - setVolumePerformanceClassGetIopsAttributeType(&o.Iops, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetLabels() (res VolumePerformanceClassGetLabelsRetType) { - 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 *VolumePerformanceClass) GetLabelsOk() (ret VolumePerformanceClassGetLabelsRetType, ok bool) { - return getVolumePerformanceClassGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *VolumePerformanceClass) 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 *VolumePerformanceClass) SetLabels(v VolumePerformanceClassGetLabelsRetType) { - setVolumePerformanceClassGetLabelsAttributeType(&o.Labels, v) -} - -// GetName returns the Name field value -func (o *VolumePerformanceClass) GetName() (ret VolumePerformanceClassGetNameRetType) { - 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 *VolumePerformanceClass) GetNameOk() (ret VolumePerformanceClassGetNameRetType, ok bool) { - return getVolumePerformanceClassGetNameAttributeTypeOk(o.Name) -} - -// SetName sets field value -func (o *VolumePerformanceClass) SetName(v VolumePerformanceClassGetNameRetType) { - setVolumePerformanceClassGetNameAttributeType(&o.Name, v) -} - -// GetThroughput returns the Throughput field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetThroughput() (res VolumePerformanceClassGetThroughputRetType) { - res, _ = o.GetThroughputOk() - return -} - -// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VolumePerformanceClass) GetThroughputOk() (ret VolumePerformanceClassGetThroughputRetType, ok bool) { - return getVolumePerformanceClassGetThroughputAttributeTypeOk(o.Throughput) -} - -// HasThroughput returns a boolean if a field has been set. -func (o *VolumePerformanceClass) HasThroughput() bool { - _, ok := o.GetThroughputOk() - return ok -} - -// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. -func (o *VolumePerformanceClass) SetThroughput(v VolumePerformanceClassGetThroughputRetType) { - setVolumePerformanceClassGetThroughputAttributeType(&o.Throughput, v) -} - -func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getVolumePerformanceClassGetIopsAttributeTypeOk(o.Iops); ok { - toSerialize["Iops"] = val - } - if val, ok := getVolumePerformanceClassGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getVolumePerformanceClassGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getVolumePerformanceClassGetThroughputAttributeTypeOk(o.Throughput); ok { - toSerialize["Throughput"] = val - } - return toSerialize, nil -} - -type NullableVolumePerformanceClass struct { - value *VolumePerformanceClass - isSet bool -} - -func (v NullableVolumePerformanceClass) Get() *VolumePerformanceClass { - return v.value -} - -func (v *NullableVolumePerformanceClass) Set(val *VolumePerformanceClass) { - v.value = val - v.isSet = true -} - -func (v NullableVolumePerformanceClass) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumePerformanceClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumePerformanceClass(val *VolumePerformanceClass) *NullableVolumePerformanceClass { - return &NullableVolumePerformanceClass{value: val, isSet: true} -} - -func (v NullableVolumePerformanceClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumePerformanceClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_performance_class_list_response.go b/services/iaasalpha/model_volume_performance_class_list_response.go deleted file mode 100644 index bf9b3cbf5..000000000 --- a/services/iaasalpha/model_volume_performance_class_list_response.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumePerformanceClassListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumePerformanceClassListResponse{} - -/* - types and functions for items -*/ - -// isArray -type VolumePerformanceClassListResponseGetItemsAttributeType = *[]VolumePerformanceClass -type VolumePerformanceClassListResponseGetItemsArgType = []VolumePerformanceClass -type VolumePerformanceClassListResponseGetItemsRetType = []VolumePerformanceClass - -func getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(arg VolumePerformanceClassListResponseGetItemsAttributeType) (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumePerformanceClassListResponseGetItemsAttributeType(arg *VolumePerformanceClassListResponseGetItemsAttributeType, val VolumePerformanceClassListResponseGetItemsRetType) { - *arg = &val -} - -// VolumePerformanceClassListResponse Volume performance class list response. -type VolumePerformanceClassListResponse struct { - // A list containing Volume performance classes. - // REQUIRED - Items VolumePerformanceClassListResponseGetItemsAttributeType `json:"items" required:"true"` -} - -type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse - -// NewVolumePerformanceClassListResponse instantiates a new VolumePerformanceClassListResponse 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 NewVolumePerformanceClassListResponse(items VolumePerformanceClassListResponseGetItemsArgType) *VolumePerformanceClassListResponse { - this := VolumePerformanceClassListResponse{} - setVolumePerformanceClassListResponseGetItemsAttributeType(&this.Items, items) - return &this -} - -// NewVolumePerformanceClassListResponseWithDefaults instantiates a new VolumePerformanceClassListResponse 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 NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClassListResponse { - this := VolumePerformanceClassListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *VolumePerformanceClassListResponse) GetItems() (ret VolumePerformanceClassListResponseGetItemsRetType) { - 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 *VolumePerformanceClassListResponse) GetItemsOk() (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { - return getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items) -} - -// SetItems sets field value -func (o *VolumePerformanceClassListResponse) SetItems(v VolumePerformanceClassListResponseGetItemsRetType) { - setVolumePerformanceClassListResponseGetItemsAttributeType(&o.Items, v) -} - -func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val - } - return toSerialize, nil -} - -type NullableVolumePerformanceClassListResponse struct { - value *VolumePerformanceClassListResponse - isSet bool -} - -func (v NullableVolumePerformanceClassListResponse) Get() *VolumePerformanceClassListResponse { - return v.value -} - -func (v *NullableVolumePerformanceClassListResponse) Set(val *VolumePerformanceClassListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableVolumePerformanceClassListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumePerformanceClassListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumePerformanceClassListResponse(val *VolumePerformanceClassListResponse) *NullableVolumePerformanceClassListResponse { - return &NullableVolumePerformanceClassListResponse{value: val, isSet: true} -} - -func (v NullableVolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumePerformanceClassListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_performance_class_list_response_test.go b/services/iaasalpha/model_volume_performance_class_list_response_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_performance_class_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_performance_class_test.go b/services/iaasalpha/model_volume_performance_class_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_performance_class_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_source.go b/services/iaasalpha/model_volume_source.go deleted file mode 100644 index e89cdbacb..000000000 --- a/services/iaasalpha/model_volume_source.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the VolumeSource type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VolumeSource{} - -/* - types and functions for id -*/ - -// isNotNullableString -type VolumeSourceGetIdAttributeType = *string - -func getVolumeSourceGetIdAttributeTypeOk(arg VolumeSourceGetIdAttributeType) (ret VolumeSourceGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeSourceGetIdAttributeType(arg *VolumeSourceGetIdAttributeType, val VolumeSourceGetIdRetType) { - *arg = &val -} - -type VolumeSourceGetIdArgType = string -type VolumeSourceGetIdRetType = string - -/* - types and functions for type -*/ - -// isNotNullableString -type VolumeSourceGetTypeAttributeType = *string - -func getVolumeSourceGetTypeAttributeTypeOk(arg VolumeSourceGetTypeAttributeType) (ret VolumeSourceGetTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setVolumeSourceGetTypeAttributeType(arg *VolumeSourceGetTypeAttributeType, val VolumeSourceGetTypeRetType) { - *arg = &val -} - -type VolumeSourceGetTypeArgType = string -type VolumeSourceGetTypeRetType = string - -// VolumeSource The source object of a volume. -type VolumeSource struct { - // Universally Unique Identifier (UUID). - // REQUIRED - Id VolumeSourceGetIdAttributeType `json:"id" required:"true"` - // The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`. - // REQUIRED - Type VolumeSourceGetTypeAttributeType `json:"type" required:"true"` -} - -type _VolumeSource VolumeSource - -// NewVolumeSource instantiates a new VolumeSource 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 NewVolumeSource(id VolumeSourceGetIdArgType, types VolumeSourceGetTypeArgType) *VolumeSource { - this := VolumeSource{} - setVolumeSourceGetIdAttributeType(&this.Id, id) - setVolumeSourceGetTypeAttributeType(&this.Type, types) - return &this -} - -// NewVolumeSourceWithDefaults instantiates a new VolumeSource 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 NewVolumeSourceWithDefaults() *VolumeSource { - this := VolumeSource{} - return &this -} - -// GetId returns the Id field value -func (o *VolumeSource) GetId() (ret VolumeSourceGetIdRetType) { - 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 *VolumeSource) GetIdOk() (ret VolumeSourceGetIdRetType, ok bool) { - return getVolumeSourceGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *VolumeSource) SetId(v VolumeSourceGetIdRetType) { - setVolumeSourceGetIdAttributeType(&o.Id, v) -} - -// GetType returns the Type field value -func (o *VolumeSource) GetType() (ret VolumeSourceGetTypeRetType) { - 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 *VolumeSource) GetTypeOk() (ret VolumeSourceGetTypeRetType, ok bool) { - return getVolumeSourceGetTypeAttributeTypeOk(o.Type) -} - -// SetType sets field value -func (o *VolumeSource) SetType(v VolumeSourceGetTypeRetType) { - setVolumeSourceGetTypeAttributeType(&o.Type, v) -} - -func (o VolumeSource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getVolumeSourceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getVolumeSourceGetTypeAttributeTypeOk(o.Type); ok { - toSerialize["Type"] = val - } - return toSerialize, nil -} - -type NullableVolumeSource struct { - value *VolumeSource - isSet bool -} - -func (v NullableVolumeSource) Get() *VolumeSource { - return v.value -} - -func (v *NullableVolumeSource) Set(val *VolumeSource) { - v.value = val - v.isSet = true -} - -func (v NullableVolumeSource) IsSet() bool { - return v.isSet -} - -func (v *NullableVolumeSource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVolumeSource(val *VolumeSource) *NullableVolumeSource { - return &NullableVolumeSource{value: val, isSet: true} -} - -func (v NullableVolumeSource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVolumeSource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_source_test.go b/services/iaasalpha/model_volume_source_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_source_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/model_volume_test.go b/services/iaasalpha/model_volume_test.go deleted file mode 100644 index 3a7814d4e..000000000 --- a/services/iaasalpha/model_volume_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha diff --git a/services/iaasalpha/utils.go b/services/iaasalpha/utils.go index 5ecdb0aa7..ac3c54961 100644 --- a/services/iaasalpha/utils.go +++ b/services/iaasalpha/utils.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1alpha1 +API version: 2alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.