From 8d5be9666941fc4820c68001bdb27a8a1b3006d4 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 16 Oct 2026 12:18:35 +0000 Subject: [PATCH] Generate iaas --- services/iaas/oas_commit | 2 +- services/iaas/v2alpha1api/api_default.go | 9274 ----------------- services/iaas/v2alpha1api/api_default_mock.go | 933 -- services/iaas/v2alpha1api/client.go | 668 -- services/iaas/v2alpha1api/configuration.go | 38 - ...del_add_routes_to_routing_table_payload.go | 168 - ...model_add_routing_table_to_area_payload.go | 481 - .../model_add_vpc_routing_table_payload.go | 443 - .../model_add_vpc_static_route_payload.go | 349 - ...dd_vpc_static_route_payload_destination.go | 154 - ...el_add_vpc_static_route_payload_nexthop.go | 218 - .../v2alpha1api/model_create_network_ipv4.go | 164 - .../model_create_network_ipv4_with_prefix.go | 293 - ..._create_network_ipv4_with_prefix_length.go | 243 - .../v2alpha1api/model_create_network_ipv6.go | 164 - .../model_create_network_ipv6_with_prefix.go | 293 - ..._create_network_ipv6_with_prefix_length.go | 243 - .../model_create_network_payload.go | 436 - .../model_create_vpc_network_range_payload.go | 122 - .../v2alpha1api/model_create_vpc_payload.go | 244 - .../model_create_vpc_region_payload.go | 192 - .../v2alpha1api/model_destination_cidrv4.go | 197 - .../v2alpha1api/model_destination_cidrv6.go | 197 - services/iaas/v2alpha1api/model_error.go | 197 - services/iaas/v2alpha1api/model_network.go | 568 - .../iaas/v2alpha1api/model_network_ipv4.go | 330 - .../iaas/v2alpha1api/model_network_ipv6.go | 292 - .../model_network_list_response.go | 168 - .../model_network_range_ipv4_request.go | 437 - ...l_network_range_ipv4_request_ip_version.go | 112 - .../v2alpha1api/model_nexthop_blackhole.go | 167 - .../v2alpha1api/model_nexthop_internet.go | 167 - .../iaas/v2alpha1api/model_nexthop_ipv4.go | 197 - .../iaas/v2alpha1api/model_nexthop_ipv6.go | 197 - .../model_partial_update_network_payload.go | 381 - .../model_partial_update_vpc_payload.go | 231 - .../iaas/v2alpha1api/model_regional_vpc.go | 192 - .../v2alpha1api/model_regional_vpc_list.go | 167 - .../v2alpha1api/model_regional_vpcipv4.go | 167 - services/iaas/v2alpha1api/model_route.go | 349 - .../v2alpha1api/model_route_destination.go | 154 - .../v2alpha1api/model_route_list_response.go | 168 - .../iaas/v2alpha1api/model_route_nexthop.go | 218 - .../iaas/v2alpha1api/model_routing_table.go | 481 - .../model_routing_table_list_response.go | 168 - .../model_update_network_ipv4_body.go | 204 - .../model_update_network_ipv6_body.go | 204 - ...l_update_route_of_routing_table_payload.go | 155 - ...el_update_routing_table_of_area_payload.go | 307 - .../model_update_vpc_network_range_payload.go | 122 - .../model_update_vpc_region_payload.go | 192 - .../model_update_vpc_routing_table_payload.go | 307 - .../model_update_vpc_static_route_payload.go | 155 - .../model_v1_update_vpc_network_range_ipv4.go | 395 - ...pdate_vpc_network_range_ipv4_ip_version.go | 112 - services/iaas/v2alpha1api/model_vpc.go | 349 - .../model_vpc_base_network_range.go | 346 - services/iaas/v2alpha1api/model_vpc_list.go | 168 - .../v2alpha1api/model_vpc_network_range.go | 154 - .../model_vpc_network_range_ipv4.go | 590 -- ...pc_network_range_ipv4_all_of_ip_version.go | 112 - .../model_vpc_network_range_ipv6.go | 578 - ...pc_network_range_ipv6_all_of_ip_version.go | 112 - .../model_vpc_network_range_list.go | 168 - .../v2alpha1api/model_vpc_routing_table.go | 443 - .../model_vpc_routing_table_list.go | 168 - services/iaas/v2alpha1api/response.go | 48 - services/iaas/v2alpha1api/utils.go | 362 - services/iaas/v2alpha1api/wait/wait.go | 123 - services/iaas/v2alpha1api/wait/wait_test.go | 328 - 70 files changed, 1 insertion(+), 27225 deletions(-) delete mode 100644 services/iaas/v2alpha1api/api_default.go delete mode 100644 services/iaas/v2alpha1api/api_default_mock.go delete mode 100644 services/iaas/v2alpha1api/client.go delete mode 100644 services/iaas/v2alpha1api/configuration.go delete mode 100644 services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go delete mode 100644 services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go delete mode 100644 services/iaas/v2alpha1api/model_add_vpc_routing_table_payload.go delete mode 100644 services/iaas/v2alpha1api/model_add_vpc_static_route_payload.go delete mode 100644 services/iaas/v2alpha1api/model_add_vpc_static_route_payload_destination.go delete mode 100644 services/iaas/v2alpha1api/model_add_vpc_static_route_payload_nexthop.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go delete mode 100644 services/iaas/v2alpha1api/model_create_network_payload.go delete mode 100644 services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go delete mode 100644 services/iaas/v2alpha1api/model_create_vpc_payload.go delete mode 100644 services/iaas/v2alpha1api/model_create_vpc_region_payload.go delete mode 100644 services/iaas/v2alpha1api/model_destination_cidrv4.go delete mode 100644 services/iaas/v2alpha1api/model_destination_cidrv6.go delete mode 100644 services/iaas/v2alpha1api/model_error.go delete mode 100644 services/iaas/v2alpha1api/model_network.go delete mode 100644 services/iaas/v2alpha1api/model_network_ipv4.go delete mode 100644 services/iaas/v2alpha1api/model_network_ipv6.go delete mode 100644 services/iaas/v2alpha1api/model_network_list_response.go delete mode 100644 services/iaas/v2alpha1api/model_network_range_ipv4_request.go delete mode 100644 services/iaas/v2alpha1api/model_network_range_ipv4_request_ip_version.go delete mode 100644 services/iaas/v2alpha1api/model_nexthop_blackhole.go delete mode 100644 services/iaas/v2alpha1api/model_nexthop_internet.go delete mode 100644 services/iaas/v2alpha1api/model_nexthop_ipv4.go delete mode 100644 services/iaas/v2alpha1api/model_nexthop_ipv6.go delete mode 100644 services/iaas/v2alpha1api/model_partial_update_network_payload.go delete mode 100644 services/iaas/v2alpha1api/model_partial_update_vpc_payload.go delete mode 100644 services/iaas/v2alpha1api/model_regional_vpc.go delete mode 100644 services/iaas/v2alpha1api/model_regional_vpc_list.go delete mode 100644 services/iaas/v2alpha1api/model_regional_vpcipv4.go delete mode 100644 services/iaas/v2alpha1api/model_route.go delete mode 100644 services/iaas/v2alpha1api/model_route_destination.go delete mode 100644 services/iaas/v2alpha1api/model_route_list_response.go delete mode 100644 services/iaas/v2alpha1api/model_route_nexthop.go delete mode 100644 services/iaas/v2alpha1api/model_routing_table.go delete mode 100644 services/iaas/v2alpha1api/model_routing_table_list_response.go delete mode 100644 services/iaas/v2alpha1api/model_update_network_ipv4_body.go delete mode 100644 services/iaas/v2alpha1api/model_update_network_ipv6_body.go delete mode 100644 services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go delete mode 100644 services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go delete mode 100644 services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go delete mode 100644 services/iaas/v2alpha1api/model_update_vpc_region_payload.go delete mode 100644 services/iaas/v2alpha1api/model_update_vpc_routing_table_payload.go delete mode 100644 services/iaas/v2alpha1api/model_update_vpc_static_route_payload.go delete mode 100644 services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4.go delete mode 100644 services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4_ip_version.go delete mode 100644 services/iaas/v2alpha1api/model_vpc.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_base_network_range.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_list.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range_ipv4.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range_ipv4_all_of_ip_version.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range_ipv6.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range_ipv6_all_of_ip_version.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_network_range_list.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_routing_table.go delete mode 100644 services/iaas/v2alpha1api/model_vpc_routing_table_list.go delete mode 100644 services/iaas/v2alpha1api/response.go delete mode 100644 services/iaas/v2alpha1api/utils.go delete mode 100644 services/iaas/v2alpha1api/wait/wait.go delete mode 100644 services/iaas/v2alpha1api/wait/wait_test.go diff --git a/services/iaas/oas_commit b/services/iaas/oas_commit index 71a76821d4..6a8ba08d49 100644 --- a/services/iaas/oas_commit +++ b/services/iaas/oas_commit @@ -1 +1 @@ -0afa5e4924e6bf230fdade5cb294ecfd97dd63e5 +ef9232ba8d49c72fc3397a365b09ca1a8205b25e diff --git a/services/iaas/v2alpha1api/api_default.go b/services/iaas/v2alpha1api/api_default.go deleted file mode 100644 index 7daf31c224..0000000000 --- a/services/iaas/v2alpha1api/api_default.go +++ /dev/null @@ -1,9274 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v2alpha1api - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - - "github.com/stackitcloud/stackit-sdk-go/core/config" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" -) - -type DefaultAPI interface { - - /* - AddRoutesToRoutingTable Create new routes in a routing table. - - Create new routes in an existing routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiAddRoutesToRoutingTableRequest - */ - AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest - - // AddRoutesToRoutingTableExecute executes the request - // @return RouteListResponse - AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) - - /* - AddRoutingTableToArea Create new routing table in a network area. - - Create a new routing table in an existing network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @return ApiAddRoutingTableToAreaRequest - */ - AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest - - // AddRoutingTableToAreaExecute executes the request - // @return RoutingTable - AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) - - /* - AddVPCRoutingTable Create a new regional routing table in a VPC. - - Create a new routing table in an existing VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiAddVPCRoutingTableRequest - */ - AddVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string) ApiAddVPCRoutingTableRequest - - // AddVPCRoutingTableExecute executes the request - // @return VPCRoutingTable - AddVPCRoutingTableExecute(r ApiAddVPCRoutingTableRequest) (*VPCRoutingTable, error) - - /* - AddVPCStaticRoute Create new regional static route. - - Create a new static route in the VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiAddVPCStaticRouteRequest - */ - AddVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiAddVPCStaticRouteRequest - - // AddVPCStaticRouteExecute executes the request - // @return Route - AddVPCStaticRouteExecute(r ApiAddVPCStaticRouteRequest) (*Route, 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. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param region The STACKIT Region of the resources. - @return ApiCreateNetworkRequest - */ - CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest - - // CreateNetworkExecute executes the request - // @return Network - CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) - - /* - CreateVPC Create a new VPC. - - Create a new VPC 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 ApiCreateVPCRequest - */ - CreateVPC(ctx context.Context, projectId string) ApiCreateVPCRequest - - // CreateVPCExecute executes the request - // @return VPC - CreateVPCExecute(r ApiCreateVPCRequest) (*VPC, error) - - /* - CreateVPCNetworkRange Create new regional network ranges in a VPC. - - Create a new network range in an existing VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiCreateVPCNetworkRangeRequest - */ - CreateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCNetworkRangeRequest - - // CreateVPCNetworkRangeExecute executes the request - // @return VPCNetworkRange - CreateVPCNetworkRangeExecute(r ApiCreateVPCNetworkRangeRequest) (*VPCNetworkRange, error) - - /* - CreateVPCRegion Create the regional configuration of a VPC. - - Create the configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiCreateVPCRegionRequest - */ - CreateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCRegionRequest - - // CreateVPCRegionExecute executes the request - // @return RegionalVPC - CreateVPCRegionExecute(r ApiCreateVPCRegionRequest) (*RegionalVPC, 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 region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiDeleteNetworkRequest - */ - DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest - - // DeleteNetworkExecute executes the request - DeleteNetworkExecute(r ApiDeleteNetworkRequest) error - - /* - DeleteRouteFromRoutingTable Delete a route in a routing table. - - Delete a route in an existing routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiDeleteRouteFromRoutingTableRequest - */ - DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest - - // DeleteRouteFromRoutingTableExecute executes the request - DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error - - /* - DeleteRoutingTableFromArea Delete a routing table. - - Delete a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiDeleteRoutingTableFromAreaRequest - */ - DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest - - // DeleteRoutingTableFromAreaExecute executes the request - DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error - - /* - DeleteVPC Delete a VPC. - - Delete an existing VPC 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 vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiDeleteVPCRequest - */ - DeleteVPC(ctx context.Context, projectId string, vpcId string) ApiDeleteVPCRequest - - // DeleteVPCExecute executes the request - DeleteVPCExecute(r ApiDeleteVPCRequest) error - - /* - DeleteVPCNetworkRange Delete a regional network range. - - Delete a network range of a VPC for this region, if the network range is not used anymore. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiDeleteVPCNetworkRangeRequest - */ - DeleteVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiDeleteVPCNetworkRangeRequest - - // DeleteVPCNetworkRangeExecute executes the request - DeleteVPCNetworkRangeExecute(r ApiDeleteVPCNetworkRangeRequest) error - - /* - DeleteVPCRegion Delete the regional configuration of a VPC. - - Delete the current configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiDeleteVPCRegionRequest - */ - DeleteVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiDeleteVPCRegionRequest - - // DeleteVPCRegionExecute executes the request - DeleteVPCRegionExecute(r ApiDeleteVPCRegionRequest) error - - /* - DeleteVPCRoutingTable Delete a regional routing table. - - Delete a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiDeleteVPCRoutingTableRequest - */ - DeleteVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiDeleteVPCRoutingTableRequest - - // DeleteVPCRoutingTableExecute executes the request - DeleteVPCRoutingTableExecute(r ApiDeleteVPCRoutingTableRequest) error - - /* - DeleteVPCStaticRoute Delete a regional static route. - - Delete a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiDeleteVPCStaticRouteRequest - */ - DeleteVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiDeleteVPCStaticRouteRequest - - // DeleteVPCStaticRouteExecute executes the request - DeleteVPCStaticRouteExecute(r ApiDeleteVPCStaticRouteRequest) error - - /* - GetNetwork Get network details. - - Get details about a network of a project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest - */ - GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest - - // GetNetworkExecute executes the request - // @return Network - GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) - - /* - GetRouteOfRoutingTable Get details about a route of a routing table. - - Get details about a route defined in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiGetRouteOfRoutingTableRequest - */ - GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest - - // GetRouteOfRoutingTableExecute executes the request - // @return Route - GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) - - /* - GetRoutingTableOfArea Get details about a routing table. - - Get details about a routing table defined in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiGetRoutingTableOfAreaRequest - */ - GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest - - // GetRoutingTableOfAreaExecute executes the request - // @return RoutingTable - GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) - - /* - GetVPC Get details about a VPC. - - Get details about a VPC 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 vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiGetVPCRequest - */ - GetVPC(ctx context.Context, projectId string, vpcId string) ApiGetVPCRequest - - // GetVPCExecute executes the request - // @return VPC - GetVPCExecute(r ApiGetVPCRequest) (*VPC, error) - - /* - GetVPCNetworkRange Get details about a regional network range. - - Get details about a network range in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiGetVPCNetworkRangeRequest - */ - GetVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiGetVPCNetworkRangeRequest - - // GetVPCNetworkRangeExecute executes the request - // @return VPCNetworkRange - GetVPCNetworkRangeExecute(r ApiGetVPCNetworkRangeRequest) (*VPCNetworkRange, error) - - /* - GetVPCRegion Get the regional configuration of a VPC. - - Get the current configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiGetVPCRegionRequest - */ - GetVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiGetVPCRegionRequest - - // GetVPCRegionExecute executes the request - // @return RegionalVPC - GetVPCRegionExecute(r ApiGetVPCRegionRequest) (*RegionalVPC, error) - - /* - GetVPCRoutingTable Get details about a regional routing table. - - Get details about a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiGetVPCRoutingTableRequest - */ - GetVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiGetVPCRoutingTableRequest - - // GetVPCRoutingTableExecute executes the request - // @return VPCRoutingTable - GetVPCRoutingTableExecute(r ApiGetVPCRoutingTableRequest) (*VPCRoutingTable, error) - - /* - GetVPCStaticRoute Get details about a regional static route. - - Get details about a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiGetVPCStaticRouteRequest - */ - GetVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiGetVPCStaticRouteRequest - - // GetVPCStaticRouteExecute executes the request - // @return Route - GetVPCStaticRouteExecute(r ApiGetVPCStaticRouteRequest) (*Route, 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. - @param region The STACKIT Region of the resources. - @return ApiListNetworksRequest - */ - ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest - - // ListNetworksExecute executes the request - // @return NetworkListResponse - ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) - - /* - ListNetworksOfRoutingTable List all networks in a routing table. - - Get a list of all networks in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListNetworksOfRoutingTableRequest - */ - ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest - - // ListNetworksOfRoutingTableExecute executes the request - // @return NetworkListResponse - ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) - - /* - ListRoutesOfRoutingTable List all routes in a routing table. - - Get a list of all routes in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListRoutesOfRoutingTableRequest - */ - ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest - - // ListRoutesOfRoutingTableExecute executes the request - // @return RouteListResponse - ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) - - /* - ListRoutingTablesOfArea List all routing tables in a network area. - - Get a list of all routing tables in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @return ApiListRoutingTablesOfAreaRequest - */ - ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest - - // ListRoutingTablesOfAreaExecute executes the request - // @return RoutingTableListResponse - ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) - - /* - ListVPCNetworkRanges List all regional network ranges in a VPC. - - Get a list of all network ranges in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiListVPCNetworkRangesRequest - */ - ListVPCNetworkRanges(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCNetworkRangesRequest - - // ListVPCNetworkRangesExecute executes the request - // @return VPCNetworkRangeList - ListVPCNetworkRangesExecute(r ApiListVPCNetworkRangesRequest) (*VPCNetworkRangeList, error) - - /* - ListVPCRegions List all configured regions in a VPC. - - Get a list of all configured regions in a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiListVPCRegionsRequest - */ - ListVPCRegions(ctx context.Context, projectId string, vpcId string) ApiListVPCRegionsRequest - - // ListVPCRegionsExecute executes the request - // @return RegionalVPCList - ListVPCRegionsExecute(r ApiListVPCRegionsRequest) (*RegionalVPCList, error) - - /* - ListVPCRoutingTables List all regional routing tables in a VPC. - - Get a list of all routing tables in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiListVPCRoutingTablesRequest - */ - ListVPCRoutingTables(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCRoutingTablesRequest - - // ListVPCRoutingTablesExecute executes the request - // @return VPCRoutingTableList - ListVPCRoutingTablesExecute(r ApiListVPCRoutingTablesRequest) (*VPCRoutingTableList, error) - - /* - ListVPCStaticRoutes List all regional static routes in a VPC. - - Get a list of all static routes of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListVPCStaticRoutesRequest - */ - ListVPCStaticRoutes(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiListVPCStaticRoutesRequest - - // ListVPCStaticRoutesExecute executes the request - // @return RouteListResponse - ListVPCStaticRoutesExecute(r ApiListVPCStaticRoutesRequest) (*RouteListResponse, error) - - /* - ListVPCs List project VPCs. - - List all visible VPCs of this project. To list shared VPCs from other projects of the organization use the `List all shared VPCs` endpoint. - - @param ctx context.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 ApiListVPCsRequest - */ - ListVPCs(ctx context.Context, projectId string) ApiListVPCsRequest - - // ListVPCsExecute executes the request - // @return VPCList - ListVPCsExecute(r ApiListVPCsRequest) (*VPCList, error) - - /* - PartialUpdateNetwork Update network settings. - - Update the settings of a network inside a project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiPartialUpdateNetworkRequest - */ - PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest - - // PartialUpdateNetworkExecute executes the request - PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error - - /* - PartialUpdateVPC Update VPC settings. - - Update the settings of a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiPartialUpdateVPCRequest - */ - PartialUpdateVPC(ctx context.Context, projectId string, vpcId string) ApiPartialUpdateVPCRequest - - // PartialUpdateVPCExecute executes the request - // @return VPC - PartialUpdateVPCExecute(r ApiPartialUpdateVPCRequest) (*VPC, error) - - /* - UpdateRouteOfRoutingTable Update a route of a routing table. - - Update a route defined in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiUpdateRouteOfRoutingTableRequest - */ - UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest - - // UpdateRouteOfRoutingTableExecute executes the request - // @return Route - UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) - - /* - UpdateRoutingTableOfArea Update a routing table. - - Update a routing table defined in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiUpdateRoutingTableOfAreaRequest - */ - UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest - - // UpdateRoutingTableOfAreaExecute executes the request - // @return RoutingTable - UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) - - /* - UpdateVPCNetworkRange Update a regional network range. - - Update a network range of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiUpdateVPCNetworkRangeRequest - */ - UpdateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiUpdateVPCNetworkRangeRequest - - // UpdateVPCNetworkRangeExecute executes the request - // @return VPCNetworkRange - UpdateVPCNetworkRangeExecute(r ApiUpdateVPCNetworkRangeRequest) (*VPCNetworkRange, error) - - /* - UpdateVPCRegion Update the regional configuration of a VPC. - - Update the current configuration of a region for a VPC. - - **Example:** Update nameservers. - - **Request Body:** - ```json - { - "ipv4": { - "defaultNameservers": [ - "10.1.2.10", - "10.1.2.11" - ], - } - } - ``` - - **Result:** - * `ipv4.defaultNameservers`: **Updated** as a new value was provided. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiUpdateVPCRegionRequest - */ - UpdateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiUpdateVPCRegionRequest - - // UpdateVPCRegionExecute executes the request - // @return RegionalVPC - UpdateVPCRegionExecute(r ApiUpdateVPCRegionRequest) (*RegionalVPC, error) - - /* - UpdateVPCRoutingTable Update a regional routing table. - - Update a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiUpdateVPCRoutingTableRequest - */ - UpdateVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiUpdateVPCRoutingTableRequest - - // UpdateVPCRoutingTableExecute executes the request - // @return VPCRoutingTable - UpdateVPCRoutingTableExecute(r ApiUpdateVPCRoutingTableRequest) (*VPCRoutingTable, error) - - /* - UpdateVPCStaticRoute Update a regional static route. - - Update a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiUpdateVPCStaticRouteRequest - */ - UpdateVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiUpdateVPCStaticRouteRequest - - // UpdateVPCStaticRouteExecute executes the request - // @return Route - UpdateVPCStaticRouteExecute(r ApiUpdateVPCStaticRouteRequest) (*Route, error) -} - -// DefaultAPIService DefaultAPI service -type DefaultAPIService service - -type ApiAddRoutesToRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload -} - -// Request an addition of routes to a routing table. -func (r ApiAddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { - r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload - return r -} - -func (r ApiAddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { - return r.ApiService.AddRoutesToRoutingTableExecute(r) -} - -/* -AddRoutesToRoutingTable Create new routes in a routing table. - -Create new routes in an existing routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiAddRoutesToRoutingTableRequest -*/ -func (a *DefaultAPIService) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { - return ApiAddRoutesToRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return RouteListResponse -func (a *DefaultAPIService) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RouteListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutesToRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if r.addRoutesToRoutingTablePayload == nil { - return localVarReturnValue, reportError("addRoutesToRoutingTablePayload 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.addRoutesToRoutingTablePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiAddRoutingTableToAreaRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload -} - -// Request an addition of a routing table to an area. -func (r ApiAddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { - r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload - return r -} - -func (r ApiAddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { - return r.ApiService.AddRoutingTableToAreaExecute(r) -} - -/* -AddRoutingTableToArea Create new routing table in a network area. - -Create a new routing table in an existing network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @return ApiAddRoutingTableToAreaRequest -*/ -func (a *DefaultAPIService) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { - return ApiAddRoutingTableToAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - } -} - -// Execute executes the request -// -// @return RoutingTable -func (a *DefaultAPIService) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutingTableToArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if r.addRoutingTableToAreaPayload == nil { - return localVarReturnValue, reportError("addRoutingTableToAreaPayload 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.addRoutingTableToAreaPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiAddVPCRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - addVPCRoutingTablePayload *AddVPCRoutingTablePayload -} - -// Request an addition of a routing table to a VPC. -func (r ApiAddVPCRoutingTableRequest) AddVPCRoutingTablePayload(addVPCRoutingTablePayload AddVPCRoutingTablePayload) ApiAddVPCRoutingTableRequest { - r.addVPCRoutingTablePayload = &addVPCRoutingTablePayload - return r -} - -func (r ApiAddVPCRoutingTableRequest) Execute() (*VPCRoutingTable, error) { - return r.ApiService.AddVPCRoutingTableExecute(r) -} - -/* -AddVPCRoutingTable Create a new regional routing table in a VPC. - -Create a new routing table in an existing VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiAddVPCRoutingTableRequest -*/ -func (a *DefaultAPIService) AddVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string) ApiAddVPCRoutingTableRequest { - return ApiAddVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return VPCRoutingTable -func (a *DefaultAPIService) AddVPCRoutingTableExecute(r ApiAddVPCRoutingTableRequest) (*VPCRoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCRoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddVPCRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if r.addVPCRoutingTablePayload == nil { - return localVarReturnValue, reportError("addVPCRoutingTablePayload 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.addVPCRoutingTablePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiAddVPCStaticRouteRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - addVPCStaticRoutePayload *AddVPCStaticRoutePayload -} - -// Request to add a static route to a VPC. -func (r ApiAddVPCStaticRouteRequest) AddVPCStaticRoutePayload(addVPCStaticRoutePayload AddVPCStaticRoutePayload) ApiAddVPCStaticRouteRequest { - r.addVPCStaticRoutePayload = &addVPCStaticRoutePayload - return r -} - -func (r ApiAddVPCStaticRouteRequest) Execute() (*Route, error) { - return r.ApiService.AddVPCStaticRouteExecute(r) -} - -/* -AddVPCStaticRoute Create new regional static route. - -Create a new static route in the VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiAddVPCStaticRouteRequest -*/ -func (a *DefaultAPIService) AddVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiAddVPCStaticRouteRequest { - return ApiAddVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return Route -func (a *DefaultAPIService) AddVPCStaticRouteExecute(r ApiAddVPCStaticRouteRequest) (*Route, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Route - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddVPCStaticRoute") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if r.addVPCStaticRoutePayload == nil { - return localVarReturnValue, reportError("addVPCStaticRoutePayload 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.addVPCStaticRoutePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiCreateNetworkRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - createNetworkPayload *CreateNetworkPayload -} - -// Request a network creation. -func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { - r.createNetworkPayload = &createNetworkPayload - return r -} - -func (r ApiCreateNetworkRequest) Execute() (*Network, error) { - return r.ApiService.CreateNetworkExecute(r) -} - -/* -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 region The STACKIT Region of the resources. - @return ApiCreateNetworkRequest -*/ -func (a *DefaultAPIService) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { - return ApiCreateNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Execute executes the request -// -// @return Network -func (a *DefaultAPIService) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Network - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetwork") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if r.createNetworkPayload == nil { - return localVarReturnValue, reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiCreateVPCRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - createVPCPayload *CreateVPCPayload -} - -// Request a VPC creation. -func (r ApiCreateVPCRequest) CreateVPCPayload(createVPCPayload CreateVPCPayload) ApiCreateVPCRequest { - r.createVPCPayload = &createVPCPayload - return r -} - -func (r ApiCreateVPCRequest) Execute() (*VPC, error) { - return r.ApiService.CreateVPCExecute(r) -} - -/* -CreateVPC Create a new VPC. - -Create a new VPC 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 ApiCreateVPCRequest -*/ -func (a *DefaultAPIService) CreateVPC(ctx context.Context, projectId string) ApiCreateVPCRequest { - return ApiCreateVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return VPC -func (a *DefaultAPIService) CreateVPCExecute(r ApiCreateVPCRequest) (*VPC, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVPC") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs" - 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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if r.createVPCPayload == nil { - return localVarReturnValue, reportError("createVPCPayload 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.createVPCPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiCreateVPCNetworkRangeRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - createVPCNetworkRangePayload *CreateVPCNetworkRangePayload -} - -// Request to add an additional network range to a VPC. -func (r ApiCreateVPCNetworkRangeRequest) CreateVPCNetworkRangePayload(createVPCNetworkRangePayload CreateVPCNetworkRangePayload) ApiCreateVPCNetworkRangeRequest { - r.createVPCNetworkRangePayload = &createVPCNetworkRangePayload - return r -} - -func (r ApiCreateVPCNetworkRangeRequest) Execute() (*VPCNetworkRange, error) { - return r.ApiService.CreateVPCNetworkRangeExecute(r) -} - -/* -CreateVPCNetworkRange Create new regional network ranges in a VPC. - -Create a new network range in an existing VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiCreateVPCNetworkRangeRequest -*/ -func (a *DefaultAPIService) CreateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCNetworkRangeRequest { - return ApiCreateVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return VPCNetworkRange -func (a *DefaultAPIService) CreateVPCNetworkRangeExecute(r ApiCreateVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCNetworkRange - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVPCNetworkRange") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if r.createVPCNetworkRangePayload == nil { - return localVarReturnValue, reportError("createVPCNetworkRangePayload 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.createVPCNetworkRangePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiCreateVPCRegionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - createVPCRegionPayload *CreateVPCRegionPayload -} - -// Request to add a new regional VPC configuration. -func (r ApiCreateVPCRegionRequest) CreateVPCRegionPayload(createVPCRegionPayload CreateVPCRegionPayload) ApiCreateVPCRegionRequest { - r.createVPCRegionPayload = &createVPCRegionPayload - return r -} - -func (r ApiCreateVPCRegionRequest) Execute() (*RegionalVPC, error) { - return r.ApiService.CreateVPCRegionExecute(r) -} - -/* -CreateVPCRegion Create the regional configuration of a VPC. - -Create the configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiCreateVPCRegionRequest -*/ -func (a *DefaultAPIService) CreateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCRegionRequest { - return ApiCreateVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return RegionalVPC -func (a *DefaultAPIService) CreateVPCRegionExecute(r ApiCreateVPCRegionRequest) (*RegionalVPC, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RegionalVPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVPCRegion") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if r.createVPCRegionPayload == nil { - return localVarReturnValue, reportError("createVPCRegionPayload 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.createVPCRegionPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiDeleteNetworkRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - networkId string -} - -func (r ApiDeleteNetworkRequest) Execute() error { - return r.ApiService.DeleteNetworkExecute(r) -} - -/* -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 region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiDeleteNetworkRequest -*/ -func (a *DefaultAPIService) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { - return ApiDeleteNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetwork") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.projectId) < 36 { - return reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return reportError("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 = a.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 -} - -type ApiDeleteRouteFromRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - routeId string -} - -func (r ApiDeleteRouteFromRoutingTableRequest) Execute() error { - return r.ApiService.DeleteRouteFromRoutingTableExecute(r) -} - -/* -DeleteRouteFromRoutingTable Delete a route in a routing table. - -Delete a route in an existing routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiDeleteRouteFromRoutingTableRequest -*/ -func (a *DefaultAPIService) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { - return ApiDeleteRouteFromRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRouteFromRoutingTable") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 -} - -type ApiDeleteRoutingTableFromAreaRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string -} - -func (r ApiDeleteRoutingTableFromAreaRequest) Execute() error { - return r.ApiService.DeleteRoutingTableFromAreaExecute(r) -} - -/* -DeleteRoutingTableFromArea Delete a routing table. - -Delete a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiDeleteRoutingTableFromAreaRequest -*/ -func (a *DefaultAPIService) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { - return ApiDeleteRoutingTableFromAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRoutingTableFromArea") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return reportError("routingTableId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 -} - -type ApiDeleteVPCRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string -} - -func (r ApiDeleteVPCRequest) Execute() error { - return r.ApiService.DeleteVPCExecute(r) -} - -/* -DeleteVPC Delete a VPC. - -Delete an existing VPC 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 vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiDeleteVPCRequest -*/ -func (a *DefaultAPIService) DeleteVPC(ctx context.Context, projectId string, vpcId string) ApiDeleteVPCRequest { - return ApiDeleteVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteVPCExecute(r ApiDeleteVPCRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVPC") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return reportError("vpcId 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 == 424 { - var v Error - err = a.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 = a.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 -} - -type ApiDeleteVPCNetworkRangeRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - networkRangeId string -} - -func (r ApiDeleteVPCNetworkRangeRequest) Execute() error { - return r.ApiService.DeleteVPCNetworkRangeExecute(r) -} - -/* -DeleteVPCNetworkRange Delete a regional network range. - -Delete a network range of a VPC for this region, if the network range is not used anymore. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiDeleteVPCNetworkRangeRequest -*/ -func (a *DefaultAPIService) DeleteVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiDeleteVPCNetworkRangeRequest { - return ApiDeleteVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteVPCNetworkRangeExecute(r ApiDeleteVPCNetworkRangeRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVPCNetworkRange") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return reportError("vpcId must have less than 36 elements") - } - if strlen(r.networkRangeId) < 36 { - return reportError("networkRangeId must have at least 36 elements") - } - if strlen(r.networkRangeId) > 36 { - return reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 == 424 { - var v Error - err = a.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 = a.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 -} - -type ApiDeleteVPCRegionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string -} - -func (r ApiDeleteVPCRegionRequest) Execute() error { - return r.ApiService.DeleteVPCRegionExecute(r) -} - -/* -DeleteVPCRegion Delete the regional configuration of a VPC. - -Delete the current configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiDeleteVPCRegionRequest -*/ -func (a *DefaultAPIService) DeleteVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiDeleteVPCRegionRequest { - return ApiDeleteVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteVPCRegionExecute(r ApiDeleteVPCRegionRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVPCRegion") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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 reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return reportError("vpcId 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 == 424 { - var v Error - err = a.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 = a.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 -} - -type ApiDeleteVPCRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string -} - -func (r ApiDeleteVPCRoutingTableRequest) Execute() error { - return r.ApiService.DeleteVPCRoutingTableExecute(r) -} - -/* -DeleteVPCRoutingTable Delete a regional routing table. - -Delete a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiDeleteVPCRoutingTableRequest -*/ -func (a *DefaultAPIService) DeleteVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiDeleteVPCRoutingTableRequest { - return ApiDeleteVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteVPCRoutingTableExecute(r ApiDeleteVPCRoutingTableRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVPCRoutingTable") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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 reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return reportError("routingTableId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 == 424 { - var v Error - err = a.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 = a.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 -} - -type ApiDeleteVPCStaticRouteRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - routeId string -} - -func (r ApiDeleteVPCStaticRouteRequest) Execute() error { - return r.ApiService.DeleteVPCStaticRouteExecute(r) -} - -/* -DeleteVPCStaticRoute Delete a regional static route. - -Delete a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiDeleteVPCStaticRouteRequest -*/ -func (a *DefaultAPIService) DeleteVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiDeleteVPCStaticRouteRequest { - return ApiDeleteVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) DeleteVPCStaticRouteExecute(r ApiDeleteVPCStaticRouteRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVPCStaticRoute") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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 reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 == 424 { - var v Error - err = a.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 = a.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 -} - -type ApiGetNetworkRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - networkId string -} - -func (r ApiGetNetworkRequest) Execute() (*Network, error) { - return r.ApiService.GetNetworkExecute(r) -} - -/* -GetNetwork Get network details. - -Get details about a network of a project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest -*/ -func (a *DefaultAPIService) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { - return ApiGetNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// Execute executes the request -// -// @return Network -func (a *DefaultAPIService) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Network - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetwork") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return localVarReturnValue, reportError("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetRouteOfRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - routeId string -} - -func (r ApiGetRouteOfRoutingTableRequest) Execute() (*Route, error) { - return r.ApiService.GetRouteOfRoutingTableExecute(r) -} - -/* -GetRouteOfRoutingTable Get details about a route of a routing table. - -Get details about a route defined in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiGetRouteOfRoutingTableRequest -*/ -func (a *DefaultAPIService) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { - return ApiGetRouteOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -// -// @return Route -func (a *DefaultAPIService) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Route - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRouteOfRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return localVarReturnValue, reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return localVarReturnValue, reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetRoutingTableOfAreaRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string -} - -func (r ApiGetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { - return r.ApiService.GetRoutingTableOfAreaExecute(r) -} - -/* -GetRoutingTableOfArea Get details about a routing table. - -Get details about a routing table defined in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiGetRoutingTableOfAreaRequest -*/ -func (a *DefaultAPIService) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { - return ApiGetRoutingTableOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return RoutingTable -func (a *DefaultAPIService) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRoutingTableOfArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetVPCRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string -} - -func (r ApiGetVPCRequest) Execute() (*VPC, error) { - return r.ApiService.GetVPCExecute(r) -} - -/* -GetVPC Get details about a VPC. - -Get details about a VPC 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 vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiGetVPCRequest -*/ -func (a *DefaultAPIService) GetVPC(ctx context.Context, projectId string, vpcId string) ApiGetVPCRequest { - return ApiGetVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// Execute executes the request -// -// @return VPC -func (a *DefaultAPIService) GetVPCExecute(r ApiGetVPCRequest) (*VPC, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVPC") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetVPCNetworkRangeRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - networkRangeId string -} - -func (r ApiGetVPCNetworkRangeRequest) Execute() (*VPCNetworkRange, error) { - return r.ApiService.GetVPCNetworkRangeExecute(r) -} - -/* -GetVPCNetworkRange Get details about a regional network range. - -Get details about a network range in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiGetVPCNetworkRangeRequest -*/ -func (a *DefaultAPIService) GetVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiGetVPCNetworkRangeRequest { - return ApiGetVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// Execute executes the request -// -// @return VPCNetworkRange -func (a *DefaultAPIService) GetVPCNetworkRangeExecute(r ApiGetVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCNetworkRange - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVPCNetworkRange") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.networkRangeId) < 36 { - return localVarReturnValue, reportError("networkRangeId must have at least 36 elements") - } - if strlen(r.networkRangeId) > 36 { - return localVarReturnValue, reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetVPCRegionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string -} - -func (r ApiGetVPCRegionRequest) Execute() (*RegionalVPC, error) { - return r.ApiService.GetVPCRegionExecute(r) -} - -/* -GetVPCRegion Get the regional configuration of a VPC. - -Get the current configuration of a region for a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiGetVPCRegionRequest -*/ -func (a *DefaultAPIService) GetVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiGetVPCRegionRequest { - return ApiGetVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return RegionalVPC -func (a *DefaultAPIService) GetVPCRegionExecute(r ApiGetVPCRegionRequest) (*RegionalVPC, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RegionalVPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVPCRegion") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetVPCRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string -} - -func (r ApiGetVPCRoutingTableRequest) Execute() (*VPCRoutingTable, error) { - return r.ApiService.GetVPCRoutingTableExecute(r) -} - -/* -GetVPCRoutingTable Get details about a regional routing table. - -Get details about a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiGetVPCRoutingTableRequest -*/ -func (a *DefaultAPIService) GetVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiGetVPCRoutingTableRequest { - return ApiGetVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return VPCRoutingTable -func (a *DefaultAPIService) GetVPCRoutingTableExecute(r ApiGetVPCRoutingTableRequest) (*VPCRoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCRoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVPCRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiGetVPCStaticRouteRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - routeId string -} - -func (r ApiGetVPCStaticRouteRequest) Execute() (*Route, error) { - return r.ApiService.GetVPCStaticRouteExecute(r) -} - -/* -GetVPCStaticRoute Get details about a regional static route. - -Get details about a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiGetVPCStaticRouteRequest -*/ -func (a *DefaultAPIService) GetVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiGetVPCStaticRouteRequest { - return ApiGetVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -// -// @return Route -func (a *DefaultAPIService) GetVPCStaticRouteExecute(r ApiGetVPCStaticRouteRequest) (*Route, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Route - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVPCStaticRoute") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return localVarReturnValue, reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return localVarReturnValue, reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListNetworksRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - labelSelector *string -} - -// Filter resources by labels. -func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { - return r.ApiService.ListNetworksExecute(r) -} - -/* -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. - @param region The STACKIT Region of the resources. - @return ApiListNetworksRequest -*/ -func (a *DefaultAPIService) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { - return ApiListNetworksRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Execute executes the request -// -// @return NetworkListResponse -func (a *DefaultAPIService) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NetworkListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworks") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListNetworksOfRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string -} - -func (r ApiListNetworksOfRoutingTableRequest) Execute() (*NetworkListResponse, error) { - return r.ApiService.ListNetworksOfRoutingTableExecute(r) -} - -/* -ListNetworksOfRoutingTable List all networks in a routing table. - -Get a list of all networks in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListNetworksOfRoutingTableRequest -*/ -func (a *DefaultAPIService) ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest { - return ApiListNetworksOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return NetworkListResponse -func (a *DefaultAPIService) ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NetworkListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworksOfRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/networks" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListRoutesOfRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - labelSelector *string -} - -// Filter resources by labels. -func (r ApiListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ApiListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { - return r.ApiService.ListRoutesOfRoutingTableExecute(r) -} - -/* -ListRoutesOfRoutingTable List all routes in a routing table. - -Get a list of all routes in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListRoutesOfRoutingTableRequest -*/ -func (a *DefaultAPIService) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { - return ApiListRoutesOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return RouteListResponse -func (a *DefaultAPIService) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RouteListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutesOfRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListRoutingTablesOfAreaRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - labelSelector *string -} - -// Filter resources by labels. -func (r ApiListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ApiListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { - return r.ApiService.ListRoutingTablesOfAreaExecute(r) -} - -/* -ListRoutingTablesOfArea List all routing tables in a network area. - -Get a list of all routing tables in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @return ApiListRoutingTablesOfAreaRequest -*/ -func (a *DefaultAPIService) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { - return ApiListRoutingTablesOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - } -} - -// Execute executes the request -// -// @return RoutingTableListResponse -func (a *DefaultAPIService) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RoutingTableListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutingTablesOfArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListVPCNetworkRangesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - labelSelector *string - filter *string -} - -// Filter resources by labels. -func (r ApiListVPCNetworkRangesRequest) LabelSelector(labelSelector string) ApiListVPCNetworkRangesRequest { - r.labelSelector = &labelSelector - return r -} - -// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. -func (r ApiListVPCNetworkRangesRequest) Filter(filter string) ApiListVPCNetworkRangesRequest { - r.filter = &filter - return r -} - -func (r ApiListVPCNetworkRangesRequest) Execute() (*VPCNetworkRangeList, error) { - return r.ApiService.ListVPCNetworkRangesExecute(r) -} - -/* -ListVPCNetworkRanges List all regional network ranges in a VPC. - -Get a list of all network ranges in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiListVPCNetworkRangesRequest -*/ -func (a *DefaultAPIService) ListVPCNetworkRanges(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCNetworkRangesRequest { - return ApiListVPCNetworkRangesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return VPCNetworkRangeList -func (a *DefaultAPIService) ListVPCNetworkRangesExecute(r ApiListVPCNetworkRangesRequest) (*VPCNetworkRangeList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCNetworkRangeList - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVPCNetworkRanges") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListVPCRegionsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string -} - -func (r ApiListVPCRegionsRequest) Execute() (*RegionalVPCList, error) { - return r.ApiService.ListVPCRegionsExecute(r) -} - -/* -ListVPCRegions List all configured regions in a VPC. - -Get a list of all configured regions in a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiListVPCRegionsRequest -*/ -func (a *DefaultAPIService) ListVPCRegions(ctx context.Context, projectId string, vpcId string) ApiListVPCRegionsRequest { - return ApiListVPCRegionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// Execute executes the request -// -// @return RegionalVPCList -func (a *DefaultAPIService) ListVPCRegionsExecute(r ApiListVPCRegionsRequest) (*RegionalVPCList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RegionalVPCList - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVPCRegions") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListVPCRoutingTablesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - labelSelector *string - filter *string -} - -// Filter resources by labels. -func (r ApiListVPCRoutingTablesRequest) LabelSelector(labelSelector string) ApiListVPCRoutingTablesRequest { - r.labelSelector = &labelSelector - return r -} - -// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. -func (r ApiListVPCRoutingTablesRequest) Filter(filter string) ApiListVPCRoutingTablesRequest { - r.filter = &filter - return r -} - -func (r ApiListVPCRoutingTablesRequest) Execute() (*VPCRoutingTableList, error) { - return r.ApiService.ListVPCRoutingTablesExecute(r) -} - -/* -ListVPCRoutingTables List all regional routing tables in a VPC. - -Get a list of all routing tables in a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiListVPCRoutingTablesRequest -*/ -func (a *DefaultAPIService) ListVPCRoutingTables(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCRoutingTablesRequest { - return ApiListVPCRoutingTablesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return VPCRoutingTableList -func (a *DefaultAPIService) ListVPCRoutingTablesExecute(r ApiListVPCRoutingTablesRequest) (*VPCRoutingTableList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCRoutingTableList - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVPCRoutingTables") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListVPCStaticRoutesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - labelSelector *string -} - -// Filter resources by labels. -func (r ApiListVPCStaticRoutesRequest) LabelSelector(labelSelector string) ApiListVPCStaticRoutesRequest { - r.labelSelector = &labelSelector - return r -} - -func (r ApiListVPCStaticRoutesRequest) Execute() (*RouteListResponse, error) { - return r.ApiService.ListVPCStaticRoutesExecute(r) -} - -/* -ListVPCStaticRoutes List all regional static routes in a VPC. - -Get a list of all static routes of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiListVPCStaticRoutesRequest -*/ -func (a *DefaultAPIService) ListVPCStaticRoutes(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiListVPCStaticRoutesRequest { - return ApiListVPCStaticRoutesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return RouteListResponse -func (a *DefaultAPIService) ListVPCStaticRoutesExecute(r ApiListVPCStaticRoutesRequest) (*RouteListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RouteListResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVPCStaticRoutes") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiListVPCsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - labelSelector *string - filter *string -} - -// Filter resources by labels. -func (r ApiListVPCsRequest) LabelSelector(labelSelector string) ApiListVPCsRequest { - r.labelSelector = &labelSelector - return r -} - -// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. -func (r ApiListVPCsRequest) Filter(filter string) ApiListVPCsRequest { - r.filter = &filter - return r -} - -func (r ApiListVPCsRequest) Execute() (*VPCList, error) { - return r.ApiService.ListVPCsExecute(r) -} - -/* -ListVPCs List project VPCs. - -List all visible VPCs of this project. To list shared VPCs from other projects of the organization use the `List all shared VPCs` endpoint. - - @param ctx context.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 ApiListVPCsRequest -*/ -func (a *DefaultAPIService) ListVPCs(ctx context.Context, projectId string) ApiListVPCsRequest { - return ApiListVPCsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return VPCList -func (a *DefaultAPIService) ListVPCsExecute(r ApiListVPCsRequest) (*VPCList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCList - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVPCs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs" - 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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") - } - // 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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiPartialUpdateNetworkRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - networkId string - partialUpdateNetworkPayload *PartialUpdateNetworkPayload -} - -// Request an update of a network. -func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { - r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload - return r -} - -func (r ApiPartialUpdateNetworkRequest) Execute() error { - return r.ApiService.PartialUpdateNetworkExecute(r) -} - -/* -PartialUpdateNetwork Update network settings. - -Update the settings of a network inside a project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param region The STACKIT Region of the resources. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiPartialUpdateNetworkRequest -*/ -func (a *DefaultAPIService) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { - return ApiPartialUpdateNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetwork") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.projectId) < 36 { - return reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return reportError("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return reportError("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return reportError("networkId must have less than 36 elements") - } - if r.partialUpdateNetworkPayload == nil { - return reportError("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 := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.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 = a.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 = a.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 = a.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 = a.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 -} - -type ApiPartialUpdateVPCRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - partialUpdateVPCPayload *PartialUpdateVPCPayload -} - -// Request to update a VPC. -func (r ApiPartialUpdateVPCRequest) PartialUpdateVPCPayload(partialUpdateVPCPayload PartialUpdateVPCPayload) ApiPartialUpdateVPCRequest { - r.partialUpdateVPCPayload = &partialUpdateVPCPayload - return r -} - -func (r ApiPartialUpdateVPCRequest) Execute() (*VPC, error) { - return r.ApiService.PartialUpdateVPCExecute(r) -} - -/* -PartialUpdateVPC Update VPC settings. - -Update the settings of a VPC. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @return ApiPartialUpdateVPCRequest -*/ -func (a *DefaultAPIService) PartialUpdateVPC(ctx context.Context, projectId string, vpcId string) ApiPartialUpdateVPCRequest { - return ApiPartialUpdateVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// Execute executes the request -// -// @return VPC -func (a *DefaultAPIService) PartialUpdateVPCExecute(r ApiPartialUpdateVPCRequest) (*VPC, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateVPC") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if r.partialUpdateVPCPayload == nil { - return localVarReturnValue, reportError("partialUpdateVPCPayload 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.partialUpdateVPCPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateRouteOfRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - routeId string - updateRouteOfRoutingTablePayload *UpdateRouteOfRoutingTablePayload -} - -// Request an update of a route in a routing table. -func (r ApiUpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { - r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload - return r -} - -func (r ApiUpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { - return r.ApiService.UpdateRouteOfRoutingTableExecute(r) -} - -/* -UpdateRouteOfRoutingTable Update a route of a routing table. - -Update a route defined in a routing table of a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiUpdateRouteOfRoutingTableRequest -*/ -func (a *DefaultAPIService) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { - return ApiUpdateRouteOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -// -// @return Route -func (a *DefaultAPIService) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Route - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRouteOfRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return localVarReturnValue, reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return localVarReturnValue, reportError("routeId must have less than 36 elements") - } - if r.updateRouteOfRoutingTablePayload == nil { - return localVarReturnValue, reportError("updateRouteOfRoutingTablePayload 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.updateRouteOfRoutingTablePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateRoutingTableOfAreaRequest struct { - ctx context.Context - ApiService DefaultAPI - organizationId string - areaId string - region string - routingTableId string - updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload -} - -// Request an update of a routing table. -func (r ApiUpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { - r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload - return r -} - -func (r ApiUpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { - return r.ApiService.UpdateRoutingTableOfAreaExecute(r) -} - -/* -UpdateRoutingTableOfArea Update a routing table. - -Update a routing table defined in a network area. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiUpdateRoutingTableOfAreaRequest -*/ -func (a *DefaultAPIService) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { - return ApiUpdateRoutingTableOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return RoutingTable -func (a *DefaultAPIService) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRoutingTableOfArea") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - 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.organizationId) < 36 { - return localVarReturnValue, reportError("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, reportError("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, reportError("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, reportError("areaId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if r.updateRoutingTableOfAreaPayload == nil { - return localVarReturnValue, reportError("updateRoutingTableOfAreaPayload 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.updateRoutingTableOfAreaPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateVPCNetworkRangeRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - networkRangeId string - updateVPCNetworkRangePayload *UpdateVPCNetworkRangePayload -} - -// Request an update of a network range. -func (r ApiUpdateVPCNetworkRangeRequest) UpdateVPCNetworkRangePayload(updateVPCNetworkRangePayload UpdateVPCNetworkRangePayload) ApiUpdateVPCNetworkRangeRequest { - r.updateVPCNetworkRangePayload = &updateVPCNetworkRangePayload - return r -} - -func (r ApiUpdateVPCNetworkRangeRequest) Execute() (*VPCNetworkRange, error) { - return r.ApiService.UpdateVPCNetworkRangeExecute(r) -} - -/* -UpdateVPCNetworkRange Update a regional network range. - -Update a network range of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiUpdateVPCNetworkRangeRequest -*/ -func (a *DefaultAPIService) UpdateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiUpdateVPCNetworkRangeRequest { - return ApiUpdateVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// Execute executes the request -// -// @return VPCNetworkRange -func (a *DefaultAPIService) UpdateVPCNetworkRangeExecute(r ApiUpdateVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCNetworkRange - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVPCNetworkRange") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/network-ranges/{networkRangeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.networkRangeId) < 36 { - return localVarReturnValue, reportError("networkRangeId must have at least 36 elements") - } - if strlen(r.networkRangeId) > 36 { - return localVarReturnValue, reportError("networkRangeId must have less than 36 elements") - } - if r.updateVPCNetworkRangePayload == nil { - return localVarReturnValue, reportError("updateVPCNetworkRangePayload 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.updateVPCNetworkRangePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateVPCRegionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - updateVPCRegionPayload *UpdateVPCRegionPayload -} - -// Request an update of the regional VPC configuration. -func (r ApiUpdateVPCRegionRequest) UpdateVPCRegionPayload(updateVPCRegionPayload UpdateVPCRegionPayload) ApiUpdateVPCRegionRequest { - r.updateVPCRegionPayload = &updateVPCRegionPayload - return r -} - -func (r ApiUpdateVPCRegionRequest) Execute() (*RegionalVPC, error) { - return r.ApiService.UpdateVPCRegionExecute(r) -} - -/* -UpdateVPCRegion Update the regional configuration of a VPC. - -Update the current configuration of a region for a VPC. - -**Example:** Update nameservers. - -**Request Body:** -```json - - { - "ipv4": { - "defaultNameservers": [ - "10.1.2.10", - "10.1.2.11" - ], - } - } - -``` - -**Result:** -* `ipv4.defaultNameservers`: **Updated** as a new value was provided. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @return ApiUpdateVPCRegionRequest -*/ -func (a *DefaultAPIService) UpdateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiUpdateVPCRegionRequest { - return ApiUpdateVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// Execute executes the request -// -// @return RegionalVPC -func (a *DefaultAPIService) UpdateVPCRegionExecute(r ApiUpdateVPCRegionRequest) (*RegionalVPC, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RegionalVPC - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVPCRegion") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if r.updateVPCRegionPayload == nil { - return localVarReturnValue, reportError("updateVPCRegionPayload 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.updateVPCRegionPayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateVPCRoutingTableRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - updateVPCRoutingTablePayload *UpdateVPCRoutingTablePayload -} - -// Request an update of a routing table. -func (r ApiUpdateVPCRoutingTableRequest) UpdateVPCRoutingTablePayload(updateVPCRoutingTablePayload UpdateVPCRoutingTablePayload) ApiUpdateVPCRoutingTableRequest { - r.updateVPCRoutingTablePayload = &updateVPCRoutingTablePayload - return r -} - -func (r ApiUpdateVPCRoutingTableRequest) Execute() (*VPCRoutingTable, error) { - return r.ApiService.UpdateVPCRoutingTableExecute(r) -} - -/* -UpdateVPCRoutingTable Update a regional routing table. - -Update a routing table of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @param region The STACKIT Region of the resources. - @param routingTableId The identifier (ID) of a STACKIT Routing Table. - @return ApiUpdateVPCRoutingTableRequest -*/ -func (a *DefaultAPIService) UpdateVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiUpdateVPCRoutingTableRequest { - return ApiUpdateVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// Execute executes the request -// -// @return VPCRoutingTable -func (a *DefaultAPIService) UpdateVPCRoutingTableExecute(r ApiUpdateVPCRoutingTableRequest) (*VPCRoutingTable, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VPCRoutingTable - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVPCRoutingTable") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if r.updateVPCRoutingTablePayload == nil { - return localVarReturnValue, reportError("updateVPCRoutingTablePayload 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.updateVPCRoutingTablePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} - -type ApiUpdateVPCStaticRouteRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - vpcId string - region string - routingTableId string - routeId string - updateVPCStaticRoutePayload *UpdateVPCStaticRoutePayload -} - -// Request an update of a static route. -func (r ApiUpdateVPCStaticRouteRequest) UpdateVPCStaticRoutePayload(updateVPCStaticRoutePayload UpdateVPCStaticRoutePayload) ApiUpdateVPCStaticRouteRequest { - r.updateVPCStaticRoutePayload = &updateVPCStaticRoutePayload - return r -} - -func (r ApiUpdateVPCStaticRouteRequest) Execute() (*Route, error) { - return r.ApiService.UpdateVPCStaticRouteExecute(r) -} - -/* -UpdateVPCStaticRoute Update a regional static route. - -Update a static route of a VPC for this region. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - @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 ApiUpdateVPCStaticRouteRequest -*/ -func (a *DefaultAPIService) UpdateVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiUpdateVPCStaticRouteRequest { - return ApiUpdateVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// Execute executes the request -// -// @return Route -func (a *DefaultAPIService) UpdateVPCStaticRouteExecute(r ApiUpdateVPCStaticRouteRequest) (*Route, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Route - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVPCStaticRoute") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/vpcs/{vpcId}/regions/{region}/routing-tables/{routingTableId}/static-routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"vpcId"+"}", url.PathEscape(parameterValueToString(r.vpcId, "vpcId")), -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, reportError("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") - } - if strlen(r.vpcId) < 36 { - return localVarReturnValue, reportError("vpcId must have at least 36 elements") - } - if strlen(r.vpcId) > 36 { - return localVarReturnValue, reportError("vpcId must have less than 36 elements") - } - if strlen(r.routingTableId) < 36 { - return localVarReturnValue, reportError("routingTableId must have at least 36 elements") - } - if strlen(r.routingTableId) > 36 { - return localVarReturnValue, reportError("routingTableId must have less than 36 elements") - } - if strlen(r.routeId) < 36 { - return localVarReturnValue, reportError("routeId must have at least 36 elements") - } - if strlen(r.routeId) > 36 { - return localVarReturnValue, reportError("routeId must have less than 36 elements") - } - if r.updateVPCStaticRoutePayload == nil { - return localVarReturnValue, reportError("updateVPCStaticRoutePayload 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.updateVPCStaticRoutePayload - req, err := a.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 := a.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{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 424 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != 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 = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-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 = a.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 -} diff --git a/services/iaas/v2alpha1api/api_default_mock.go b/services/iaas/v2alpha1api/api_default_mock.go deleted file mode 100644 index 80b1e1d694..0000000000 --- a/services/iaas/v2alpha1api/api_default_mock.go +++ /dev/null @@ -1,933 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "context" -) - -// assert the implementation matches the interface -var _ DefaultAPI = &DefaultAPIServiceMock{} - -// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. -// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. -type DefaultAPIServiceMock struct { - // AddRoutesToRoutingTableExecuteMock can be populated to implement the behavior of the AddRoutesToRoutingTableExecute function of this mock - AddRoutesToRoutingTableExecuteMock *func(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) - // AddRoutingTableToAreaExecuteMock can be populated to implement the behavior of the AddRoutingTableToAreaExecute function of this mock - AddRoutingTableToAreaExecuteMock *func(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) - // AddVPCRoutingTableExecuteMock can be populated to implement the behavior of the AddVPCRoutingTableExecute function of this mock - AddVPCRoutingTableExecuteMock *func(r ApiAddVPCRoutingTableRequest) (*VPCRoutingTable, error) - // AddVPCStaticRouteExecuteMock can be populated to implement the behavior of the AddVPCStaticRouteExecute function of this mock - AddVPCStaticRouteExecuteMock *func(r ApiAddVPCStaticRouteRequest) (*Route, error) - // CreateNetworkExecuteMock can be populated to implement the behavior of the CreateNetworkExecute function of this mock - CreateNetworkExecuteMock *func(r ApiCreateNetworkRequest) (*Network, error) - // CreateVPCExecuteMock can be populated to implement the behavior of the CreateVPCExecute function of this mock - CreateVPCExecuteMock *func(r ApiCreateVPCRequest) (*VPC, error) - // CreateVPCNetworkRangeExecuteMock can be populated to implement the behavior of the CreateVPCNetworkRangeExecute function of this mock - CreateVPCNetworkRangeExecuteMock *func(r ApiCreateVPCNetworkRangeRequest) (*VPCNetworkRange, error) - // CreateVPCRegionExecuteMock can be populated to implement the behavior of the CreateVPCRegionExecute function of this mock - CreateVPCRegionExecuteMock *func(r ApiCreateVPCRegionRequest) (*RegionalVPC, error) - // DeleteNetworkExecuteMock can be populated to implement the behavior of the DeleteNetworkExecute function of this mock - DeleteNetworkExecuteMock *func(r ApiDeleteNetworkRequest) error - // DeleteRouteFromRoutingTableExecuteMock can be populated to implement the behavior of the DeleteRouteFromRoutingTableExecute function of this mock - DeleteRouteFromRoutingTableExecuteMock *func(r ApiDeleteRouteFromRoutingTableRequest) error - // DeleteRoutingTableFromAreaExecuteMock can be populated to implement the behavior of the DeleteRoutingTableFromAreaExecute function of this mock - DeleteRoutingTableFromAreaExecuteMock *func(r ApiDeleteRoutingTableFromAreaRequest) error - // DeleteVPCExecuteMock can be populated to implement the behavior of the DeleteVPCExecute function of this mock - DeleteVPCExecuteMock *func(r ApiDeleteVPCRequest) error - // DeleteVPCNetworkRangeExecuteMock can be populated to implement the behavior of the DeleteVPCNetworkRangeExecute function of this mock - DeleteVPCNetworkRangeExecuteMock *func(r ApiDeleteVPCNetworkRangeRequest) error - // DeleteVPCRegionExecuteMock can be populated to implement the behavior of the DeleteVPCRegionExecute function of this mock - DeleteVPCRegionExecuteMock *func(r ApiDeleteVPCRegionRequest) error - // DeleteVPCRoutingTableExecuteMock can be populated to implement the behavior of the DeleteVPCRoutingTableExecute function of this mock - DeleteVPCRoutingTableExecuteMock *func(r ApiDeleteVPCRoutingTableRequest) error - // DeleteVPCStaticRouteExecuteMock can be populated to implement the behavior of the DeleteVPCStaticRouteExecute function of this mock - DeleteVPCStaticRouteExecuteMock *func(r ApiDeleteVPCStaticRouteRequest) error - // GetNetworkExecuteMock can be populated to implement the behavior of the GetNetworkExecute function of this mock - GetNetworkExecuteMock *func(r ApiGetNetworkRequest) (*Network, error) - // GetRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the GetRouteOfRoutingTableExecute function of this mock - GetRouteOfRoutingTableExecuteMock *func(r ApiGetRouteOfRoutingTableRequest) (*Route, error) - // GetRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the GetRoutingTableOfAreaExecute function of this mock - GetRoutingTableOfAreaExecuteMock *func(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) - // GetVPCExecuteMock can be populated to implement the behavior of the GetVPCExecute function of this mock - GetVPCExecuteMock *func(r ApiGetVPCRequest) (*VPC, error) - // GetVPCNetworkRangeExecuteMock can be populated to implement the behavior of the GetVPCNetworkRangeExecute function of this mock - GetVPCNetworkRangeExecuteMock *func(r ApiGetVPCNetworkRangeRequest) (*VPCNetworkRange, error) - // GetVPCRegionExecuteMock can be populated to implement the behavior of the GetVPCRegionExecute function of this mock - GetVPCRegionExecuteMock *func(r ApiGetVPCRegionRequest) (*RegionalVPC, error) - // GetVPCRoutingTableExecuteMock can be populated to implement the behavior of the GetVPCRoutingTableExecute function of this mock - GetVPCRoutingTableExecuteMock *func(r ApiGetVPCRoutingTableRequest) (*VPCRoutingTable, error) - // GetVPCStaticRouteExecuteMock can be populated to implement the behavior of the GetVPCStaticRouteExecute function of this mock - GetVPCStaticRouteExecuteMock *func(r ApiGetVPCStaticRouteRequest) (*Route, error) - // ListNetworksExecuteMock can be populated to implement the behavior of the ListNetworksExecute function of this mock - ListNetworksExecuteMock *func(r ApiListNetworksRequest) (*NetworkListResponse, error) - // ListNetworksOfRoutingTableExecuteMock can be populated to implement the behavior of the ListNetworksOfRoutingTableExecute function of this mock - ListNetworksOfRoutingTableExecuteMock *func(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) - // ListRoutesOfRoutingTableExecuteMock can be populated to implement the behavior of the ListRoutesOfRoutingTableExecute function of this mock - ListRoutesOfRoutingTableExecuteMock *func(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) - // ListRoutingTablesOfAreaExecuteMock can be populated to implement the behavior of the ListRoutingTablesOfAreaExecute function of this mock - ListRoutingTablesOfAreaExecuteMock *func(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) - // ListVPCNetworkRangesExecuteMock can be populated to implement the behavior of the ListVPCNetworkRangesExecute function of this mock - ListVPCNetworkRangesExecuteMock *func(r ApiListVPCNetworkRangesRequest) (*VPCNetworkRangeList, error) - // ListVPCRegionsExecuteMock can be populated to implement the behavior of the ListVPCRegionsExecute function of this mock - ListVPCRegionsExecuteMock *func(r ApiListVPCRegionsRequest) (*RegionalVPCList, error) - // ListVPCRoutingTablesExecuteMock can be populated to implement the behavior of the ListVPCRoutingTablesExecute function of this mock - ListVPCRoutingTablesExecuteMock *func(r ApiListVPCRoutingTablesRequest) (*VPCRoutingTableList, error) - // ListVPCStaticRoutesExecuteMock can be populated to implement the behavior of the ListVPCStaticRoutesExecute function of this mock - ListVPCStaticRoutesExecuteMock *func(r ApiListVPCStaticRoutesRequest) (*RouteListResponse, error) - // ListVPCsExecuteMock can be populated to implement the behavior of the ListVPCsExecute function of this mock - ListVPCsExecuteMock *func(r ApiListVPCsRequest) (*VPCList, error) - // PartialUpdateNetworkExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkExecute function of this mock - PartialUpdateNetworkExecuteMock *func(r ApiPartialUpdateNetworkRequest) error - // PartialUpdateVPCExecuteMock can be populated to implement the behavior of the PartialUpdateVPCExecute function of this mock - PartialUpdateVPCExecuteMock *func(r ApiPartialUpdateVPCRequest) (*VPC, error) - // UpdateRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the UpdateRouteOfRoutingTableExecute function of this mock - UpdateRouteOfRoutingTableExecuteMock *func(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) - // UpdateRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the UpdateRoutingTableOfAreaExecute function of this mock - UpdateRoutingTableOfAreaExecuteMock *func(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) - // UpdateVPCNetworkRangeExecuteMock can be populated to implement the behavior of the UpdateVPCNetworkRangeExecute function of this mock - UpdateVPCNetworkRangeExecuteMock *func(r ApiUpdateVPCNetworkRangeRequest) (*VPCNetworkRange, error) - // UpdateVPCRegionExecuteMock can be populated to implement the behavior of the UpdateVPCRegionExecute function of this mock - UpdateVPCRegionExecuteMock *func(r ApiUpdateVPCRegionRequest) (*RegionalVPC, error) - // UpdateVPCRoutingTableExecuteMock can be populated to implement the behavior of the UpdateVPCRoutingTableExecute function of this mock - UpdateVPCRoutingTableExecuteMock *func(r ApiUpdateVPCRoutingTableRequest) (*VPCRoutingTable, error) - // UpdateVPCStaticRouteExecuteMock can be populated to implement the behavior of the UpdateVPCStaticRouteExecute function of this mock - UpdateVPCStaticRouteExecuteMock *func(r ApiUpdateVPCStaticRouteRequest) (*Route, error) -} - -func (a DefaultAPIServiceMock) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { - return ApiAddRoutesToRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// AddRoutesToRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutesToRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { - if a.AddRoutesToRoutingTableExecuteMock == nil { - var localVarReturnValue *RouteListResponse - return localVarReturnValue, nil - } - - return (*a.AddRoutesToRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { - return ApiAddRoutingTableToAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - } -} - -// AddRoutingTableToAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutingTableToAreaExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { - if a.AddRoutingTableToAreaExecuteMock == nil { - var localVarReturnValue *RoutingTable - return localVarReturnValue, nil - } - - return (*a.AddRoutingTableToAreaExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) AddVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string) ApiAddVPCRoutingTableRequest { - return ApiAddVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// AddVPCRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddVPCRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) AddVPCRoutingTableExecute(r ApiAddVPCRoutingTableRequest) (*VPCRoutingTable, error) { - if a.AddVPCRoutingTableExecuteMock == nil { - var localVarReturnValue *VPCRoutingTable - return localVarReturnValue, nil - } - - return (*a.AddVPCRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) AddVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiAddVPCStaticRouteRequest { - return ApiAddVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// AddVPCStaticRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddVPCStaticRouteExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) AddVPCStaticRouteExecute(r ApiAddVPCStaticRouteRequest) (*Route, error) { - if a.AddVPCStaticRouteExecuteMock == nil { - var localVarReturnValue *Route - return localVarReturnValue, nil - } - - return (*a.AddVPCStaticRouteExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { - return ApiCreateNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// CreateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { - if a.CreateNetworkExecuteMock == nil { - var localVarReturnValue *Network - return localVarReturnValue, nil - } - - return (*a.CreateNetworkExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) CreateVPC(ctx context.Context, projectId string) ApiCreateVPCRequest { - return ApiCreateVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// CreateVPCExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVPCExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateVPCExecute(r ApiCreateVPCRequest) (*VPC, error) { - if a.CreateVPCExecuteMock == nil { - var localVarReturnValue *VPC - return localVarReturnValue, nil - } - - return (*a.CreateVPCExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) CreateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCNetworkRangeRequest { - return ApiCreateVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// CreateVPCNetworkRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVPCNetworkRangeExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateVPCNetworkRangeExecute(r ApiCreateVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - if a.CreateVPCNetworkRangeExecuteMock == nil { - var localVarReturnValue *VPCNetworkRange - return localVarReturnValue, nil - } - - return (*a.CreateVPCNetworkRangeExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) CreateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiCreateVPCRegionRequest { - return ApiCreateVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// CreateVPCRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVPCRegionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateVPCRegionExecute(r ApiCreateVPCRegionRequest) (*RegionalVPC, error) { - if a.CreateVPCRegionExecuteMock == nil { - var localVarReturnValue *RegionalVPC - return localVarReturnValue, nil - } - - return (*a.CreateVPCRegionExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { - return ApiDeleteNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// DeleteNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { - if a.DeleteNetworkExecuteMock == nil { - return nil - } - - return (*a.DeleteNetworkExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { - return ApiDeleteRouteFromRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// DeleteRouteFromRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRouteFromRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { - if a.DeleteRouteFromRoutingTableExecuteMock == nil { - return nil - } - - return (*a.DeleteRouteFromRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { - return ApiDeleteRoutingTableFromAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// DeleteRoutingTableFromAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRoutingTableFromAreaExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { - if a.DeleteRoutingTableFromAreaExecuteMock == nil { - return nil - } - - return (*a.DeleteRoutingTableFromAreaExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteVPC(ctx context.Context, projectId string, vpcId string) ApiDeleteVPCRequest { - return ApiDeleteVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// DeleteVPCExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVPCExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteVPCExecute(r ApiDeleteVPCRequest) error { - if a.DeleteVPCExecuteMock == nil { - return nil - } - - return (*a.DeleteVPCExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiDeleteVPCNetworkRangeRequest { - return ApiDeleteVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// DeleteVPCNetworkRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVPCNetworkRangeExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteVPCNetworkRangeExecute(r ApiDeleteVPCNetworkRangeRequest) error { - if a.DeleteVPCNetworkRangeExecuteMock == nil { - return nil - } - - return (*a.DeleteVPCNetworkRangeExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiDeleteVPCRegionRequest { - return ApiDeleteVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// DeleteVPCRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVPCRegionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteVPCRegionExecute(r ApiDeleteVPCRegionRequest) error { - if a.DeleteVPCRegionExecuteMock == nil { - return nil - } - - return (*a.DeleteVPCRegionExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiDeleteVPCRoutingTableRequest { - return ApiDeleteVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// DeleteVPCRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVPCRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteVPCRoutingTableExecute(r ApiDeleteVPCRoutingTableRequest) error { - if a.DeleteVPCRoutingTableExecuteMock == nil { - return nil - } - - return (*a.DeleteVPCRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) DeleteVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiDeleteVPCStaticRouteRequest { - return ApiDeleteVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// DeleteVPCStaticRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVPCStaticRouteExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteVPCStaticRouteExecute(r ApiDeleteVPCStaticRouteRequest) error { - if a.DeleteVPCStaticRouteExecuteMock == nil { - return nil - } - - return (*a.DeleteVPCStaticRouteExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { - return ApiGetNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// GetNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { - if a.GetNetworkExecuteMock == nil { - var localVarReturnValue *Network - return localVarReturnValue, nil - } - - return (*a.GetNetworkExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { - return ApiGetRouteOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// GetRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { - if a.GetRouteOfRoutingTableExecuteMock == nil { - var localVarReturnValue *Route - return localVarReturnValue, nil - } - - return (*a.GetRouteOfRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { - return ApiGetRoutingTableOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// GetRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { - if a.GetRoutingTableOfAreaExecuteMock == nil { - var localVarReturnValue *RoutingTable - return localVarReturnValue, nil - } - - return (*a.GetRoutingTableOfAreaExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetVPC(ctx context.Context, projectId string, vpcId string) ApiGetVPCRequest { - return ApiGetVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// GetVPCExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVPCExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVPCExecute(r ApiGetVPCRequest) (*VPC, error) { - if a.GetVPCExecuteMock == nil { - var localVarReturnValue *VPC - return localVarReturnValue, nil - } - - return (*a.GetVPCExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiGetVPCNetworkRangeRequest { - return ApiGetVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// GetVPCNetworkRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVPCNetworkRangeExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVPCNetworkRangeExecute(r ApiGetVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - if a.GetVPCNetworkRangeExecuteMock == nil { - var localVarReturnValue *VPCNetworkRange - return localVarReturnValue, nil - } - - return (*a.GetVPCNetworkRangeExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiGetVPCRegionRequest { - return ApiGetVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// GetVPCRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVPCRegionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVPCRegionExecute(r ApiGetVPCRegionRequest) (*RegionalVPC, error) { - if a.GetVPCRegionExecuteMock == nil { - var localVarReturnValue *RegionalVPC - return localVarReturnValue, nil - } - - return (*a.GetVPCRegionExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiGetVPCRoutingTableRequest { - return ApiGetVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// GetVPCRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVPCRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVPCRoutingTableExecute(r ApiGetVPCRoutingTableRequest) (*VPCRoutingTable, error) { - if a.GetVPCRoutingTableExecuteMock == nil { - var localVarReturnValue *VPCRoutingTable - return localVarReturnValue, nil - } - - return (*a.GetVPCRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiGetVPCStaticRouteRequest { - return ApiGetVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// GetVPCStaticRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVPCStaticRouteExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVPCStaticRouteExecute(r ApiGetVPCStaticRouteRequest) (*Route, error) { - if a.GetVPCStaticRouteExecuteMock == nil { - var localVarReturnValue *Route - return localVarReturnValue, nil - } - - return (*a.GetVPCStaticRouteExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { - return ApiListNetworksRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// ListNetworksExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { - if a.ListNetworksExecuteMock == nil { - var localVarReturnValue *NetworkListResponse - return localVarReturnValue, nil - } - - return (*a.ListNetworksExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest { - return ApiListNetworksOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// ListNetworksOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) { - if a.ListNetworksOfRoutingTableExecuteMock == nil { - var localVarReturnValue *NetworkListResponse - return localVarReturnValue, nil - } - - return (*a.ListNetworksOfRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { - return ApiListRoutesOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// ListRoutesOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutesOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { - if a.ListRoutesOfRoutingTableExecuteMock == nil { - var localVarReturnValue *RouteListResponse - return localVarReturnValue, nil - } - - return (*a.ListRoutesOfRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { - return ApiListRoutingTablesOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - } -} - -// ListRoutingTablesOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutingTablesOfAreaExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { - if a.ListRoutingTablesOfAreaExecuteMock == nil { - var localVarReturnValue *RoutingTableListResponse - return localVarReturnValue, nil - } - - return (*a.ListRoutingTablesOfAreaExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVPCNetworkRanges(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCNetworkRangesRequest { - return ApiListVPCNetworkRangesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// ListVPCNetworkRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVPCNetworkRangesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListVPCNetworkRangesExecute(r ApiListVPCNetworkRangesRequest) (*VPCNetworkRangeList, error) { - if a.ListVPCNetworkRangesExecuteMock == nil { - var localVarReturnValue *VPCNetworkRangeList - return localVarReturnValue, nil - } - - return (*a.ListVPCNetworkRangesExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVPCRegions(ctx context.Context, projectId string, vpcId string) ApiListVPCRegionsRequest { - return ApiListVPCRegionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// ListVPCRegionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVPCRegionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListVPCRegionsExecute(r ApiListVPCRegionsRequest) (*RegionalVPCList, error) { - if a.ListVPCRegionsExecuteMock == nil { - var localVarReturnValue *RegionalVPCList - return localVarReturnValue, nil - } - - return (*a.ListVPCRegionsExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVPCRoutingTables(ctx context.Context, projectId string, vpcId string, region string) ApiListVPCRoutingTablesRequest { - return ApiListVPCRoutingTablesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// ListVPCRoutingTablesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVPCRoutingTablesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListVPCRoutingTablesExecute(r ApiListVPCRoutingTablesRequest) (*VPCRoutingTableList, error) { - if a.ListVPCRoutingTablesExecuteMock == nil { - var localVarReturnValue *VPCRoutingTableList - return localVarReturnValue, nil - } - - return (*a.ListVPCRoutingTablesExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVPCStaticRoutes(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiListVPCStaticRoutesRequest { - return ApiListVPCStaticRoutesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// ListVPCStaticRoutesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVPCStaticRoutesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListVPCStaticRoutesExecute(r ApiListVPCStaticRoutesRequest) (*RouteListResponse, error) { - if a.ListVPCStaticRoutesExecuteMock == nil { - var localVarReturnValue *RouteListResponse - return localVarReturnValue, nil - } - - return (*a.ListVPCStaticRoutesExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVPCs(ctx context.Context, projectId string) ApiListVPCsRequest { - return ApiListVPCsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// ListVPCsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVPCsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListVPCsExecute(r ApiListVPCsRequest) (*VPCList, error) { - if a.ListVPCsExecuteMock == nil { - var localVarReturnValue *VPCList - return localVarReturnValue, nil - } - - return (*a.ListVPCsExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { - return ApiPartialUpdateNetworkRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - networkId: networkId, - } -} - -// PartialUpdateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { - if a.PartialUpdateNetworkExecuteMock == nil { - return nil - } - - return (*a.PartialUpdateNetworkExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) PartialUpdateVPC(ctx context.Context, projectId string, vpcId string) ApiPartialUpdateVPCRequest { - return ApiPartialUpdateVPCRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - } -} - -// PartialUpdateVPCExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateVPCExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PartialUpdateVPCExecute(r ApiPartialUpdateVPCRequest) (*VPC, error) { - if a.PartialUpdateVPCExecuteMock == nil { - var localVarReturnValue *VPC - return localVarReturnValue, nil - } - - return (*a.PartialUpdateVPCExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { - return ApiUpdateRouteOfRoutingTableRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// UpdateRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { - if a.UpdateRouteOfRoutingTableExecuteMock == nil { - var localVarReturnValue *Route - return localVarReturnValue, nil - } - - return (*a.UpdateRouteOfRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { - return ApiUpdateRoutingTableOfAreaRequest{ - ApiService: a, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - region: region, - routingTableId: routingTableId, - } -} - -// UpdateRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { - if a.UpdateRoutingTableOfAreaExecuteMock == nil { - var localVarReturnValue *RoutingTable - return localVarReturnValue, nil - } - - return (*a.UpdateRoutingTableOfAreaExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateVPCNetworkRange(ctx context.Context, projectId string, vpcId string, region string, networkRangeId string) ApiUpdateVPCNetworkRangeRequest { - return ApiUpdateVPCNetworkRangeRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - networkRangeId: networkRangeId, - } -} - -// UpdateVPCNetworkRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVPCNetworkRangeExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateVPCNetworkRangeExecute(r ApiUpdateVPCNetworkRangeRequest) (*VPCNetworkRange, error) { - if a.UpdateVPCNetworkRangeExecuteMock == nil { - var localVarReturnValue *VPCNetworkRange - return localVarReturnValue, nil - } - - return (*a.UpdateVPCNetworkRangeExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateVPCRegion(ctx context.Context, projectId string, vpcId string, region string) ApiUpdateVPCRegionRequest { - return ApiUpdateVPCRegionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - } -} - -// UpdateVPCRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVPCRegionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateVPCRegionExecute(r ApiUpdateVPCRegionRequest) (*RegionalVPC, error) { - if a.UpdateVPCRegionExecuteMock == nil { - var localVarReturnValue *RegionalVPC - return localVarReturnValue, nil - } - - return (*a.UpdateVPCRegionExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateVPCRoutingTable(ctx context.Context, projectId string, vpcId string, region string, routingTableId string) ApiUpdateVPCRoutingTableRequest { - return ApiUpdateVPCRoutingTableRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - } -} - -// UpdateVPCRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVPCRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateVPCRoutingTableExecute(r ApiUpdateVPCRoutingTableRequest) (*VPCRoutingTable, error) { - if a.UpdateVPCRoutingTableExecuteMock == nil { - var localVarReturnValue *VPCRoutingTable - return localVarReturnValue, nil - } - - return (*a.UpdateVPCRoutingTableExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateVPCStaticRoute(ctx context.Context, projectId string, vpcId string, region string, routingTableId string, routeId string) ApiUpdateVPCStaticRouteRequest { - return ApiUpdateVPCStaticRouteRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - vpcId: vpcId, - region: region, - routingTableId: routingTableId, - routeId: routeId, - } -} - -// UpdateVPCStaticRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVPCStaticRouteExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateVPCStaticRouteExecute(r ApiUpdateVPCStaticRouteRequest) (*Route, error) { - if a.UpdateVPCStaticRouteExecuteMock == nil { - var localVarReturnValue *Route - return localVarReturnValue, nil - } - - return (*a.UpdateVPCStaticRouteExecuteMock)(r) -} diff --git a/services/iaas/v2alpha1api/client.go b/services/iaas/v2alpha1api/client.go deleted file mode 100644 index 966f9ab483..0000000000 --- a/services/iaas/v2alpha1api/client.go +++ /dev/null @@ -1,668 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v2alpha1api - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/stackitcloud/stackit-sdk-go/core/auth" - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -var ( - JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) - XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") -) - -// APIClient manages communication with the STACKIT IaaS API API v2alpha1 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *config.Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - DefaultAPI DefaultAPI -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { - cfg := NewConfiguration() - - for _, option := range opts { - err := option(cfg) - if err != nil { - return nil, fmt.Errorf("configuring the client: %w", err) - } - } - - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } - - if cfg.HTTPClient == nil { - cfg.HTTPClient = &http.Client{} - } - - authRoundTripper, err := auth.SetupAuth(cfg) - if err != nil { - return nil, fmt.Errorf("setting up authentication: %w", err) - } - - roundTripper := authRoundTripper - if cfg.Middleware != nil { - roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) - } - - cfg.HTTPClient.Transport = roundTripper - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultAPI = (*DefaultAPIService)(&c.common) - - return c, nil -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -func parameterValueToString(obj interface{}, key string) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { - return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) - } - - return fmt.Sprintf("%v", obj) - } - var param, ok = obj.(MappedNullable) - if !ok { - return "" - } - dataMap, err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t, ok := obj.(MappedNullable); ok { - dataMap, err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i := 0; i < lenIndValue; i++ { - var arrayValue = indValue.Index(i) - var keyPrefixForCollectionType = keyPrefix - if style == "deepObject" { - keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } - } - - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break - } -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *config.Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if r, ok := v.(*io.Reader); ok { - *r = bytes.NewReader(b) - return nil - } - // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. - if p, ok := v.(*[]byte); ok { - *p = b - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if XmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if JsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if JsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if XmlCheck.MatchString(contentType) { - var bs []byte - bs, err = xml.Marshal(body) - if err == nil { - bodyBuf.Write(bs) - } - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// format error message using title and detail when model implements rfc7807 -func formatErrorMessage(status string, v interface{}) string { - str := "" - metaValue := reflect.ValueOf(v).Elem() - - if metaValue.Kind() == reflect.Struct { - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) - } - - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - } - - return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) -} diff --git a/services/iaas/v2alpha1api/configuration.go b/services/iaas/v2alpha1api/configuration.go deleted file mode 100644 index 618fd79388..0000000000 --- a/services/iaas/v2alpha1api/configuration.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v2alpha1api - -import ( - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *config.Configuration { - cfg := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "stackit-sdk-go/iaas", - Debug: false, - Servers: config.ServerConfigurations{ - { - URL: "https://iaas.api.stackit.cloud", - Description: "No description provided", - Variables: map[string]config.ServerVariable{ - "region": { - Description: "No description provided", - DefaultValue: "global", - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - return cfg -} diff --git a/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go b/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go deleted file mode 100644 index 08b90d0172..0000000000 --- a/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the AddRoutesToRoutingTablePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddRoutesToRoutingTablePayload{} - -// AddRoutesToRoutingTablePayload Object represents a request to add network routes. -type AddRoutesToRoutingTablePayload struct { - // A list of routes. - Items []Route `json:"items"` - AdditionalProperties map[string]interface{} -} - -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 []Route) *AddRoutesToRoutingTablePayload { - this := AddRoutesToRoutingTablePayload{} - 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() []Route { - if o == nil { - var ret []Route - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *AddRoutesToRoutingTablePayload) GetItemsOk() ([]Route, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *AddRoutesToRoutingTablePayload) SetItems(v []Route) { - o.Items = v -} - -func (o AddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *AddRoutesToRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddRoutesToRoutingTablePayload := _AddRoutesToRoutingTablePayload{} - - err = json.Unmarshal(data, &varAddRoutesToRoutingTablePayload) - - if err != nil { - return err - } - - *o = AddRoutesToRoutingTablePayload(varAddRoutesToRoutingTablePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAddRoutesToRoutingTablePayload struct { - value *AddRoutesToRoutingTablePayload - isSet bool -} - -func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { - return v.value -} - -func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddRoutesToRoutingTablePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { - return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} -} - -func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go b/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go deleted file mode 100644 index d53d488a47..0000000000 --- a/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go +++ /dev/null @@ -1,481 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the AddRoutingTableToAreaPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddRoutingTableToAreaPayload{} - -// AddRoutingTableToAreaPayload An object representing a routing table. Filterable Fields: `dynamicRoutes`, `systemRoutes`. -type AddRoutingTableToAreaPayload struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. - Default *bool `json:"default,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // A config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -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 string) *AddRoutingTableToAreaPayload { - this := AddRoutingTableToAreaPayload{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - this.Name = name - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { - this := AddRoutingTableToAreaPayload{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDefault returns the Default field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetDefault() bool { - if o == nil || IsNil(o.Default) { - var ret bool - return ret - } - return *o.Default -} - -// 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() (*bool, bool) { - if o == nil || IsNil(o.Default) { - return nil, false - } - return o.Default, true -} - -// HasDefault returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasDefault() bool { - if o != nil && !IsNil(o.Default) { - return true - } - - return false -} - -// SetDefault gets a reference to the given bool and assigns it to the Default field. -func (o *AddRoutingTableToAreaPayload) SetDefault(v bool) { - o.Default = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *AddRoutingTableToAreaPayload) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *AddRoutingTableToAreaPayload) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *AddRoutingTableToAreaPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *AddRoutingTableToAreaPayload) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *AddRoutingTableToAreaPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *AddRoutingTableToAreaPayload) SetName(v string) { - o.Name = v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o AddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Default) { - toSerialize["default"] = o.Default - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *AddRoutingTableToAreaPayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddRoutingTableToAreaPayload := _AddRoutingTableToAreaPayload{} - - err = json.Unmarshal(data, &varAddRoutingTableToAreaPayload) - - if err != nil { - return err - } - - *o = AddRoutingTableToAreaPayload(varAddRoutingTableToAreaPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "default") - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAddRoutingTableToAreaPayload struct { - value *AddRoutingTableToAreaPayload - isSet bool -} - -func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { - return v.value -} - -func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddRoutingTableToAreaPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { - return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} -} - -func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_add_vpc_routing_table_payload.go b/services/iaas/v2alpha1api/model_add_vpc_routing_table_payload.go deleted file mode 100644 index fdc5fecfdc..0000000000 --- a/services/iaas/v2alpha1api/model_add_vpc_routing_table_payload.go +++ /dev/null @@ -1,443 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the AddVPCRoutingTablePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddVPCRoutingTablePayload{} - -// AddVPCRoutingTablePayload An object representing a VPC routing table. Filterable Fields: `createdAt`, `dynamicRoutes`, `name`, `systemRoutes`, `updatedAt`. -type AddVPCRoutingTablePayload struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // A config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _AddVPCRoutingTablePayload AddVPCRoutingTablePayload - -// NewAddVPCRoutingTablePayload instantiates a new AddVPCRoutingTablePayload 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 NewAddVPCRoutingTablePayload(name string) *AddVPCRoutingTablePayload { - this := AddVPCRoutingTablePayload{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - this.Name = name - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// NewAddVPCRoutingTablePayloadWithDefaults instantiates a new AddVPCRoutingTablePayload 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 NewAddVPCRoutingTablePayloadWithDefaults() *AddVPCRoutingTablePayload { - this := AddVPCRoutingTablePayload{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *AddVPCRoutingTablePayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *AddVPCRoutingTablePayload) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *AddVPCRoutingTablePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *AddVPCRoutingTablePayload) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AddVPCRoutingTablePayload) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *AddVPCRoutingTablePayload) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *AddVPCRoutingTablePayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *AddVPCRoutingTablePayload) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *AddVPCRoutingTablePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *AddVPCRoutingTablePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *AddVPCRoutingTablePayload) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *AddVPCRoutingTablePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *AddVPCRoutingTablePayload) SetName(v string) { - o.Name = v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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 *AddVPCRoutingTablePayload) GetSystemRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *AddVPCRoutingTablePayload) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *AddVPCRoutingTablePayload) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *AddVPCRoutingTablePayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *AddVPCRoutingTablePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *AddVPCRoutingTablePayload) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o AddVPCRoutingTablePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddVPCRoutingTablePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *AddVPCRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddVPCRoutingTablePayload := _AddVPCRoutingTablePayload{} - - err = json.Unmarshal(data, &varAddVPCRoutingTablePayload) - - if err != nil { - return err - } - - *o = AddVPCRoutingTablePayload(varAddVPCRoutingTablePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAddVPCRoutingTablePayload struct { - value *AddVPCRoutingTablePayload - isSet bool -} - -func (v NullableAddVPCRoutingTablePayload) Get() *AddVPCRoutingTablePayload { - return v.value -} - -func (v *NullableAddVPCRoutingTablePayload) Set(val *AddVPCRoutingTablePayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddVPCRoutingTablePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddVPCRoutingTablePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddVPCRoutingTablePayload(val *AddVPCRoutingTablePayload) *NullableAddVPCRoutingTablePayload { - return &NullableAddVPCRoutingTablePayload{value: val, isSet: true} -} - -func (v NullableAddVPCRoutingTablePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddVPCRoutingTablePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload.go b/services/iaas/v2alpha1api/model_add_vpc_static_route_payload.go deleted file mode 100644 index 31d897081e..0000000000 --- a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the AddVPCStaticRoutePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddVPCStaticRoutePayload{} - -// AddVPCStaticRoutePayload Object represents a network route. -type AddVPCStaticRoutePayload struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - Destination AddVPCStaticRoutePayloadDestination `json:"destination"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - Nexthop AddVPCStaticRoutePayloadNexthop `json:"nexthop"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _AddVPCStaticRoutePayload AddVPCStaticRoutePayload - -// NewAddVPCStaticRoutePayload instantiates a new AddVPCStaticRoutePayload 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 NewAddVPCStaticRoutePayload(destination AddVPCStaticRoutePayloadDestination, nexthop AddVPCStaticRoutePayloadNexthop) *AddVPCStaticRoutePayload { - this := AddVPCStaticRoutePayload{} - this.Destination = destination - this.Nexthop = nexthop - return &this -} - -// NewAddVPCStaticRoutePayloadWithDefaults instantiates a new AddVPCStaticRoutePayload 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 NewAddVPCStaticRoutePayloadWithDefaults() *AddVPCStaticRoutePayload { - this := AddVPCStaticRoutePayload{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *AddVPCStaticRoutePayload) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *AddVPCStaticRoutePayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *AddVPCStaticRoutePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *AddVPCStaticRoutePayload) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDestination returns the Destination field value -func (o *AddVPCStaticRoutePayload) GetDestination() AddVPCStaticRoutePayloadDestination { - if o == nil { - var ret AddVPCStaticRoutePayloadDestination - return ret - } - - return o.Destination -} - -// GetDestinationOk returns a tuple with the Destination field value -// and a boolean to check if the value has been set. -func (o *AddVPCStaticRoutePayload) GetDestinationOk() (*AddVPCStaticRoutePayloadDestination, bool) { - if o == nil { - return nil, false - } - return &o.Destination, true -} - -// SetDestination sets field value -func (o *AddVPCStaticRoutePayload) SetDestination(v AddVPCStaticRoutePayloadDestination) { - o.Destination = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *AddVPCStaticRoutePayload) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *AddVPCStaticRoutePayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *AddVPCStaticRoutePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *AddVPCStaticRoutePayload) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *AddVPCStaticRoutePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *AddVPCStaticRoutePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *AddVPCStaticRoutePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *AddVPCStaticRoutePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetNexthop returns the Nexthop field value -func (o *AddVPCStaticRoutePayload) GetNexthop() AddVPCStaticRoutePayloadNexthop { - if o == nil { - var ret AddVPCStaticRoutePayloadNexthop - return ret - } - - return o.Nexthop -} - -// GetNexthopOk returns a tuple with the Nexthop field value -// and a boolean to check if the value has been set. -func (o *AddVPCStaticRoutePayload) GetNexthopOk() (*AddVPCStaticRoutePayloadNexthop, bool) { - if o == nil { - return nil, false - } - return &o.Nexthop, true -} - -// SetNexthop sets field value -func (o *AddVPCStaticRoutePayload) SetNexthop(v AddVPCStaticRoutePayloadNexthop) { - o.Nexthop = v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *AddVPCStaticRoutePayload) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *AddVPCStaticRoutePayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *AddVPCStaticRoutePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *AddVPCStaticRoutePayload) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o AddVPCStaticRoutePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddVPCStaticRoutePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - toSerialize["destination"] = o.Destination - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["nexthop"] = o.Nexthop - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *AddVPCStaticRoutePayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "destination", - "nexthop", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddVPCStaticRoutePayload := _AddVPCStaticRoutePayload{} - - err = json.Unmarshal(data, &varAddVPCStaticRoutePayload) - - if err != nil { - return err - } - - *o = AddVPCStaticRoutePayload(varAddVPCStaticRoutePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "destination") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "nexthop") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAddVPCStaticRoutePayload struct { - value *AddVPCStaticRoutePayload - isSet bool -} - -func (v NullableAddVPCStaticRoutePayload) Get() *AddVPCStaticRoutePayload { - return v.value -} - -func (v *NullableAddVPCStaticRoutePayload) Set(val *AddVPCStaticRoutePayload) { - v.value = val - v.isSet = true -} - -func (v NullableAddVPCStaticRoutePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableAddVPCStaticRoutePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddVPCStaticRoutePayload(val *AddVPCStaticRoutePayload) *NullableAddVPCStaticRoutePayload { - return &NullableAddVPCStaticRoutePayload{value: val, isSet: true} -} - -func (v NullableAddVPCStaticRoutePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddVPCStaticRoutePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_destination.go b/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_destination.go deleted file mode 100644 index f319d643a2..0000000000 --- a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_destination.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// AddVPCStaticRoutePayloadDestination - struct for AddVPCStaticRoutePayloadDestination -type AddVPCStaticRoutePayloadDestination struct { - DestinationCIDRv4 *DestinationCIDRv4 - DestinationCIDRv6 *DestinationCIDRv6 -} - -// DestinationCIDRv4AsAddVPCStaticRoutePayloadDestination is a convenience function that returns DestinationCIDRv4 wrapped in AddVPCStaticRoutePayloadDestination -func DestinationCIDRv4AsAddVPCStaticRoutePayloadDestination(v *DestinationCIDRv4) AddVPCStaticRoutePayloadDestination { - return AddVPCStaticRoutePayloadDestination{ - DestinationCIDRv4: v, - } -} - -// DestinationCIDRv6AsAddVPCStaticRoutePayloadDestination is a convenience function that returns DestinationCIDRv6 wrapped in AddVPCStaticRoutePayloadDestination -func DestinationCIDRv6AsAddVPCStaticRoutePayloadDestination(v *DestinationCIDRv6) AddVPCStaticRoutePayloadDestination { - return AddVPCStaticRoutePayloadDestination{ - DestinationCIDRv6: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *AddVPCStaticRoutePayloadDestination) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'cidrv4' - if jsonDict["type"] == "cidrv4" { - // try to unmarshal JSON data into DestinationCIDRv4 - err = json.Unmarshal(data, &dst.DestinationCIDRv4) - if err == nil { - return nil // data stored in dst.DestinationCIDRv4, return on the first match - } else { - dst.DestinationCIDRv4 = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadDestination as DestinationCIDRv4: %s", err.Error()) - } - } - - // check if the discriminator value is 'cidrv6' - if jsonDict["type"] == "cidrv6" { - // try to unmarshal JSON data into DestinationCIDRv6 - err = json.Unmarshal(data, &dst.DestinationCIDRv6) - if err == nil { - return nil // data stored in dst.DestinationCIDRv6, return on the first match - } else { - dst.DestinationCIDRv6 = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadDestination as DestinationCIDRv6: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src AddVPCStaticRoutePayloadDestination) MarshalJSON() ([]byte, error) { - if src.DestinationCIDRv4 != nil { - return json.Marshal(&src.DestinationCIDRv4) - } - - if src.DestinationCIDRv6 != nil { - return json.Marshal(&src.DestinationCIDRv6) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *AddVPCStaticRoutePayloadDestination) 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 -} - -// Get the actual instance value -func (obj AddVPCStaticRoutePayloadDestination) GetActualInstanceValue() interface{} { - if obj.DestinationCIDRv4 != nil { - return *obj.DestinationCIDRv4 - } - - if obj.DestinationCIDRv6 != nil { - return *obj.DestinationCIDRv6 - } - - // all schemas are nil - return nil -} - -type NullableAddVPCStaticRoutePayloadDestination struct { - value *AddVPCStaticRoutePayloadDestination - isSet bool -} - -func (v NullableAddVPCStaticRoutePayloadDestination) Get() *AddVPCStaticRoutePayloadDestination { - return v.value -} - -func (v *NullableAddVPCStaticRoutePayloadDestination) Set(val *AddVPCStaticRoutePayloadDestination) { - v.value = val - v.isSet = true -} - -func (v NullableAddVPCStaticRoutePayloadDestination) IsSet() bool { - return v.isSet -} - -func (v *NullableAddVPCStaticRoutePayloadDestination) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddVPCStaticRoutePayloadDestination(val *AddVPCStaticRoutePayloadDestination) *NullableAddVPCStaticRoutePayloadDestination { - return &NullableAddVPCStaticRoutePayloadDestination{value: val, isSet: true} -} - -func (v NullableAddVPCStaticRoutePayloadDestination) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddVPCStaticRoutePayloadDestination) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_nexthop.go b/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_nexthop.go deleted file mode 100644 index 59447cec1d..0000000000 --- a/services/iaas/v2alpha1api/model_add_vpc_static_route_payload_nexthop.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// AddVPCStaticRoutePayloadNexthop - struct for AddVPCStaticRoutePayloadNexthop -type AddVPCStaticRoutePayloadNexthop struct { - NexthopBlackhole *NexthopBlackhole - NexthopIPv4 *NexthopIPv4 - NexthopIPv6 *NexthopIPv6 - NexthopInternet *NexthopInternet -} - -// NexthopBlackholeAsAddVPCStaticRoutePayloadNexthop is a convenience function that returns NexthopBlackhole wrapped in AddVPCStaticRoutePayloadNexthop -func NexthopBlackholeAsAddVPCStaticRoutePayloadNexthop(v *NexthopBlackhole) AddVPCStaticRoutePayloadNexthop { - return AddVPCStaticRoutePayloadNexthop{ - NexthopBlackhole: v, - } -} - -// NexthopIPv4AsAddVPCStaticRoutePayloadNexthop is a convenience function that returns NexthopIPv4 wrapped in AddVPCStaticRoutePayloadNexthop -func NexthopIPv4AsAddVPCStaticRoutePayloadNexthop(v *NexthopIPv4) AddVPCStaticRoutePayloadNexthop { - return AddVPCStaticRoutePayloadNexthop{ - NexthopIPv4: v, - } -} - -// NexthopIPv6AsAddVPCStaticRoutePayloadNexthop is a convenience function that returns NexthopIPv6 wrapped in AddVPCStaticRoutePayloadNexthop -func NexthopIPv6AsAddVPCStaticRoutePayloadNexthop(v *NexthopIPv6) AddVPCStaticRoutePayloadNexthop { - return AddVPCStaticRoutePayloadNexthop{ - NexthopIPv6: v, - } -} - -// NexthopInternetAsAddVPCStaticRoutePayloadNexthop is a convenience function that returns NexthopInternet wrapped in AddVPCStaticRoutePayloadNexthop -func NexthopInternetAsAddVPCStaticRoutePayloadNexthop(v *NexthopInternet) AddVPCStaticRoutePayloadNexthop { - return AddVPCStaticRoutePayloadNexthop{ - NexthopInternet: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *AddVPCStaticRoutePayloadNexthop) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'blackhole' - if jsonDict["type"] == "blackhole" { - // try to unmarshal JSON data into NexthopBlackhole - err = json.Unmarshal(data, &dst.NexthopBlackhole) - if err == nil { - return nil // data stored in dst.NexthopBlackhole, return on the first match - } else { - dst.NexthopBlackhole = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadNexthop as NexthopBlackhole: %s", err.Error()) - } - } - - // check if the discriminator value is 'internet' - if jsonDict["type"] == "internet" { - // try to unmarshal JSON data into NexthopInternet - err = json.Unmarshal(data, &dst.NexthopInternet) - if err == nil { - return nil // data stored in dst.NexthopInternet, return on the first match - } else { - dst.NexthopInternet = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadNexthop as NexthopInternet: %s", err.Error()) - } - } - - // check if the discriminator value is 'ipv4' - if jsonDict["type"] == "ipv4" { - // try to unmarshal JSON data into NexthopIPv4 - err = json.Unmarshal(data, &dst.NexthopIPv4) - if err == nil { - return nil // data stored in dst.NexthopIPv4, return on the first match - } else { - dst.NexthopIPv4 = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadNexthop as NexthopIPv4: %s", err.Error()) - } - } - - // check if the discriminator value is 'ipv6' - if jsonDict["type"] == "ipv6" { - // try to unmarshal JSON data into NexthopIPv6 - err = json.Unmarshal(data, &dst.NexthopIPv6) - if err == nil { - return nil // data stored in dst.NexthopIPv6, return on the first match - } else { - dst.NexthopIPv6 = nil - return fmt.Errorf("failed to unmarshal AddVPCStaticRoutePayloadNexthop as NexthopIPv6: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src AddVPCStaticRoutePayloadNexthop) 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 nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *AddVPCStaticRoutePayloadNexthop) 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 -} - -// Get the actual instance value -func (obj AddVPCStaticRoutePayloadNexthop) GetActualInstanceValue() interface{} { - 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 NullableAddVPCStaticRoutePayloadNexthop struct { - value *AddVPCStaticRoutePayloadNexthop - isSet bool -} - -func (v NullableAddVPCStaticRoutePayloadNexthop) Get() *AddVPCStaticRoutePayloadNexthop { - return v.value -} - -func (v *NullableAddVPCStaticRoutePayloadNexthop) Set(val *AddVPCStaticRoutePayloadNexthop) { - v.value = val - v.isSet = true -} - -func (v NullableAddVPCStaticRoutePayloadNexthop) IsSet() bool { - return v.isSet -} - -func (v *NullableAddVPCStaticRoutePayloadNexthop) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddVPCStaticRoutePayloadNexthop(val *AddVPCStaticRoutePayloadNexthop) *NullableAddVPCStaticRoutePayloadNexthop { - return &NullableAddVPCStaticRoutePayloadNexthop{value: val, isSet: true} -} - -func (v NullableAddVPCStaticRoutePayloadNexthop) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddVPCStaticRoutePayloadNexthop) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4.go b/services/iaas/v2alpha1api/model_create_network_ipv4.go deleted file mode 100644 index d1afbbd499..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv4.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -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 = json.Unmarshal(data, &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 = json.Unmarshal(data, &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 - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv4): %v", err) - } - - 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 nil, nil // no data in oneOf schemas -} - -// 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 -} - -// Get the actual instance value -func (obj CreateNetworkIPv4) GetActualInstanceValue() interface{} { - if obj.CreateNetworkIPv4WithPrefix != nil { - return *obj.CreateNetworkIPv4WithPrefix - } - - if obj.CreateNetworkIPv4WithPrefixLength != nil { - return *obj.CreateNetworkIPv4WithPrefixLength - } - - // all schemas are nil - return nil -} - -type NullableCreateNetworkIPv4 struct { - value *CreateNetworkIPv4 - isSet bool -} - -func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { - return v.value -} - -func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { - return &NullableCreateNetworkIPv4{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go deleted file mode 100644 index 73b8a2c656..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go +++ /dev/null @@ -1,293 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} - -// CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. -type CreateNetworkIPv4WithPrefix struct { - // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - // IPv4 Classless Inter-Domain Routing (CIDR). - Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 string) *CreateNetworkIPv4WithPrefix { - this := CreateNetworkIPv4WithPrefix{} - 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() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *CreateNetworkIPv4WithPrefix) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv4WithPrefix) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *CreateNetworkIPv4WithPrefix) GetPrefix() string { - if o == nil { - var ret string - return ret - } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Prefix, true -} - -// SetPrefix sets field value -func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v string) { - o.Prefix = v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *CreateNetworkIPv4WithPrefix) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4WithPrefix) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *CreateNetworkIPv4WithPrefix) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *CreateNetworkIPv4WithPrefix) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o CreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateNetworkIPv4WithPrefix) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateNetworkIPv4WithPrefix := _CreateNetworkIPv4WithPrefix{} - - err = json.Unmarshal(data, &varCreateNetworkIPv4WithPrefix) - - if err != nil { - return err - } - - *o = CreateNetworkIPv4WithPrefix(varCreateNetworkIPv4WithPrefix) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateNetworkIPv4WithPrefix struct { - value *CreateNetworkIPv4WithPrefix - isSet bool -} - -func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { - return v.value -} - -func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { - return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go deleted file mode 100644 index 88a3425095..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateNetworkIPv4WithPrefixLength type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} - -// 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 []string `json:"nameservers,omitempty"` - PrefixLength int64 `json:"prefixLength"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 int64) *CreateNetworkIPv4WithPrefixLength { - this := CreateNetworkIPv4WithPrefixLength{} - 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() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefixLength returns the PrefixLength field value -func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.PrefixLength -} - -// GetPrefixLengthOk returns a tuple with the PrefixLength field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.PrefixLength, true -} - -// SetPrefixLength sets field value -func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v int64) { - o.PrefixLength = v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *CreateNetworkIPv4WithPrefixLength) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4WithPrefixLength) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *CreateNetworkIPv4WithPrefixLength) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *CreateNetworkIPv4WithPrefixLength) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o CreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefixLength"] = o.PrefixLength - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateNetworkIPv4WithPrefixLength) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefixLength", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateNetworkIPv4WithPrefixLength := _CreateNetworkIPv4WithPrefixLength{} - - err = json.Unmarshal(data, &varCreateNetworkIPv4WithPrefixLength) - - if err != nil { - return err - } - - *o = CreateNetworkIPv4WithPrefixLength(varCreateNetworkIPv4WithPrefixLength) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefixLength") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateNetworkIPv4WithPrefixLength struct { - value *CreateNetworkIPv4WithPrefixLength - isSet bool -} - -func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { - return v.value -} - -func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { - return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6.go b/services/iaas/v2alpha1api/model_create_network_ipv6.go deleted file mode 100644 index fc225d9970..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv6.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -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 = json.Unmarshal(data, &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 = json.Unmarshal(data, &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 - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv6): %v", err) - } - - 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 nil, nil // no data in oneOf schemas -} - -// 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 -} - -// Get the actual instance value -func (obj CreateNetworkIPv6) GetActualInstanceValue() interface{} { - if obj.CreateNetworkIPv6WithPrefix != nil { - return *obj.CreateNetworkIPv6WithPrefix - } - - if obj.CreateNetworkIPv6WithPrefixLength != nil { - return *obj.CreateNetworkIPv6WithPrefixLength - } - - // all schemas are nil - return nil -} - -type NullableCreateNetworkIPv6 struct { - value *CreateNetworkIPv6 - isSet bool -} - -func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { - return v.value -} - -func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv6) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv6) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { - return &NullableCreateNetworkIPv6{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go deleted file mode 100644 index 9fe0c649b1..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go +++ /dev/null @@ -1,293 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} - -// CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. -type CreateNetworkIPv6WithPrefix struct { - // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9a-f]{1\\,4}:){7}([0-9a-f]{1\\,4}|:))|(([0-9a-f]{1\\,4}:){6}(:[0-9a-f]{1\\,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){5}(((:[0-9a-f]{1\\,4}){1\\,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){4}(((:[0-9a-f]{1\\,4}){1\\,3})|((:[0-9a-f]{1\\,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){3}(((:[0-9a-f]{1\\,4}){1\\,4})|((:[0-9a-f]{1\\,4}){0\\,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){2}(((:[0-9a-f]{1\\,4}){1\\,5})|((:[0-9a-f]{1\\,4}){0\\,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){1}(((:[0-9a-f]{1\\,4}){1\\,6})|((:[0-9a-f]{1\\,4}){0\\,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1\\,4}){1\\,7})|((:[0-9a-f]{1\\,4}){0\\,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"` - // A list containing DNS Servers/Nameservers for IPv6. - Nameservers []string `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR) for IPv6. - Prefix string `json:"prefix" validate:"regexp=^(([0-9a-fA-F]{1\\,4}:){7\\,7}[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,7}:|([0-9a-fA-F]{1\\,4}:){1\\,6}:[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,5}(:[0-9a-fA-F]{1\\,4}){1\\,2}|([0-9a-fA-F]{1\\,4}:){1\\,4}(:[0-9a-fA-F]{1\\,4}){1\\,3}|([0-9a-fA-F]{1\\,4}:){1\\,3}(:[0-9a-fA-F]{1\\,4}){1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,2}(:[0-9a-fA-F]{1\\,4}){1\\,5}|[0-9a-fA-F]{1\\,4}:((:[0-9a-fA-F]{1\\,4}){1\\,6})|:((:[0-9a-fA-F]{1\\,4}){1\\,7}|:)|fe80:(:[0-9a-fA-F]{0\\,4}){0\\,4}%[0-9a-zA-Z]{1\\,}|::(ffff(:0{1\\,4}){0\\,1}:){0\\,1}((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])|([0-9a-fA-F]{1\\,4}:){1\\,4}:((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9]))(/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 string) *CreateNetworkIPv6WithPrefix { - this := CreateNetworkIPv6WithPrefix{} - 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() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *CreateNetworkIPv6WithPrefix) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv6WithPrefix) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *CreateNetworkIPv6WithPrefix) GetPrefix() string { - if o == nil { - var ret string - return ret - } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Prefix, true -} - -// SetPrefix sets field value -func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v string) { - o.Prefix = v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *CreateNetworkIPv6WithPrefix) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6WithPrefix) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *CreateNetworkIPv6WithPrefix) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *CreateNetworkIPv6WithPrefix) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o CreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateNetworkIPv6WithPrefix) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateNetworkIPv6WithPrefix := _CreateNetworkIPv6WithPrefix{} - - err = json.Unmarshal(data, &varCreateNetworkIPv6WithPrefix) - - if err != nil { - return err - } - - *o = CreateNetworkIPv6WithPrefix(varCreateNetworkIPv6WithPrefix) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateNetworkIPv6WithPrefix struct { - value *CreateNetworkIPv6WithPrefix - isSet bool -} - -func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { - return v.value -} - -func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { - return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go deleted file mode 100644 index f295afaecf..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateNetworkIPv6WithPrefixLength type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} - -// 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 []string `json:"nameservers,omitempty"` - PrefixLength int64 `json:"prefixLength"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 int64) *CreateNetworkIPv6WithPrefixLength { - this := CreateNetworkIPv6WithPrefixLength{} - 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() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefixLength returns the PrefixLength field value -func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.PrefixLength -} - -// GetPrefixLengthOk returns a tuple with the PrefixLength field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.PrefixLength, true -} - -// SetPrefixLength sets field value -func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v int64) { - o.PrefixLength = v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *CreateNetworkIPv6WithPrefixLength) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6WithPrefixLength) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *CreateNetworkIPv6WithPrefixLength) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *CreateNetworkIPv6WithPrefixLength) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o CreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefixLength"] = o.PrefixLength - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateNetworkIPv6WithPrefixLength) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefixLength", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateNetworkIPv6WithPrefixLength := _CreateNetworkIPv6WithPrefixLength{} - - err = json.Unmarshal(data, &varCreateNetworkIPv6WithPrefixLength) - - if err != nil { - return err - } - - *o = CreateNetworkIPv6WithPrefixLength(varCreateNetworkIPv6WithPrefixLength) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefixLength") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateNetworkIPv6WithPrefixLength struct { - value *CreateNetworkIPv6WithPrefixLength - isSet bool -} - -func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { - return v.value -} - -func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { - return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} -} - -func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_network_payload.go b/services/iaas/v2alpha1api/model_create_network_payload.go deleted file mode 100644 index 05b926c76c..0000000000 --- a/services/iaas/v2alpha1api/model_create_network_payload.go +++ /dev/null @@ -1,436 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateNetworkPayload{} - -// CreateNetworkPayload Object that represents the request body for a network create. -type CreateNetworkPayload struct { - // Enable or disable DHCP for a network. - Dhcp *bool `json:"dhcp,omitempty"` - Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` - Ipv6 *CreateNetworkIPv6 `json:"ipv6,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` - // Universally Unique Identifier (UUID). - RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // The identifier (ID) of a STACKIT VPC. - VpcId *string `json:"vpcId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -type _CreateNetworkPayload CreateNetworkPayload - -// NewCreateNetworkPayload instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayload(name string) *CreateNetworkPayload { - this := CreateNetworkPayload{} - var dhcp bool = true - this.Dhcp = &dhcp - this.Name = name - return &this -} - -// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { - this := CreateNetworkPayload{} - var dhcp bool = true - this.Dhcp = &dhcp - return &this -} - -// GetDhcp returns the Dhcp field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetDhcp() bool { - if o == nil || IsNil(o.Dhcp) { - var ret bool - return ret - } - return *o.Dhcp -} - -// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetDhcpOk() (*bool, bool) { - if o == nil || IsNil(o.Dhcp) { - return nil, false - } - return o.Dhcp, true -} - -// HasDhcp returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasDhcp() bool { - if o != nil && !IsNil(o.Dhcp) { - return true - } - - return false -} - -// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. -func (o *CreateNetworkPayload) SetDhcp(v bool) { - o.Dhcp = &v -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetIpv4() CreateNetworkIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret CreateNetworkIPv4 - return ret - } - return *o.Ipv4 -} - -// 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() (*CreateNetworkIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. -func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkIPv4) { - o.Ipv4 = &v -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetIpv6() CreateNetworkIPv6 { - if o == nil || IsNil(o.Ipv6) { - var ret CreateNetworkIPv6 - return ret - } - return *o.Ipv6 -} - -// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetIpv6Ok() (*CreateNetworkIPv6, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false -} - -// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. -func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkIPv6) { - o.Ipv6 = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *CreateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *CreateNetworkPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *CreateNetworkPayload) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CreateNetworkPayload) SetName(v string) { - o.Name = v -} - -// GetRouted returns the Routed field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetRouted() bool { - if o == nil || IsNil(o.Routed) { - var ret bool - return ret - } - return *o.Routed -} - -// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true -} - -// HasRouted returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false -} - -// SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *CreateNetworkPayload) SetRouted(v bool) { - o.Routed = &v -} - -// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetRoutingTableId() string { - if o == nil || IsNil(o.RoutingTableId) { - var ret string - return ret - } - return *o.RoutingTableId -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.RoutingTableId) { - return nil, false - } - return o.RoutingTableId, true -} - -// HasRoutingTableId returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasRoutingTableId() bool { - if o != nil && !IsNil(o.RoutingTableId) { - return true - } - - return false -} - -// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. -func (o *CreateNetworkPayload) SetRoutingTableId(v string) { - o.RoutingTableId = &v -} - -// GetVpcId returns the VpcId field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetVpcId() string { - if o == nil || IsNil(o.VpcId) { - var ret string - return ret - } - return *o.VpcId -} - -// GetVpcIdOk returns a tuple with the VpcId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetVpcIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcId) { - return nil, false - } - return o.VpcId, true -} - -// HasVpcId returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasVpcId() bool { - if o != nil && !IsNil(o.VpcId) { - return true - } - - return false -} - -// SetVpcId gets a reference to the given string and assigns it to the VpcId field. -func (o *CreateNetworkPayload) SetVpcId(v string) { - o.VpcId = &v -} - -func (o CreateNetworkPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Dhcp) { - toSerialize["dhcp"] = o.Dhcp - } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed - } - if !IsNil(o.RoutingTableId) { - toSerialize["routingTableId"] = o.RoutingTableId - } - if !IsNil(o.VpcId) { - toSerialize["vpcId"] = o.VpcId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateNetworkPayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateNetworkPayload := _CreateNetworkPayload{} - - err = json.Unmarshal(data, &varCreateNetworkPayload) - - if err != nil { - return err - } - - *o = CreateNetworkPayload(varCreateNetworkPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "dhcp") - delete(additionalProperties, "ipv4") - delete(additionalProperties, "ipv6") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "routed") - delete(additionalProperties, "routingTableId") - delete(additionalProperties, "vpcId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateNetworkPayload struct { - value *CreateNetworkPayload - isSet bool -} - -func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { - return v.value -} - -func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateNetworkPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateNetworkPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { - return &NullableCreateNetworkPayload{value: val, isSet: true} -} - -func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go b/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go deleted file mode 100644 index f4295955ac..0000000000 --- a/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// CreateVPCNetworkRangePayload - The request body of a VPC network range. -type CreateVPCNetworkRangePayload struct { - NetworkRangeIPv4Request *NetworkRangeIPv4Request -} - -// NetworkRangeIPv4RequestAsCreateVPCNetworkRangePayload is a convenience function that returns NetworkRangeIPv4Request wrapped in CreateVPCNetworkRangePayload -func NetworkRangeIPv4RequestAsCreateVPCNetworkRangePayload(v *NetworkRangeIPv4Request) CreateVPCNetworkRangePayload { - return CreateVPCNetworkRangePayload{ - NetworkRangeIPv4Request: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateVPCNetworkRangePayload) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'ipv4' - if jsonDict["ipVersion"] == "ipv4" { - // try to unmarshal JSON data into NetworkRangeIPv4Request - err = json.Unmarshal(data, &dst.NetworkRangeIPv4Request) - if err == nil { - return nil // data stored in dst.NetworkRangeIPv4Request, return on the first match - } else { - dst.NetworkRangeIPv4Request = nil - return fmt.Errorf("failed to unmarshal CreateVPCNetworkRangePayload as NetworkRangeIPv4Request: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - if src.NetworkRangeIPv4Request != nil { - return json.Marshal(&src.NetworkRangeIPv4Request) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *CreateVPCNetworkRangePayload) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.NetworkRangeIPv4Request != nil { - return obj.NetworkRangeIPv4Request - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj CreateVPCNetworkRangePayload) GetActualInstanceValue() interface{} { - if obj.NetworkRangeIPv4Request != nil { - return *obj.NetworkRangeIPv4Request - } - - // all schemas are nil - return nil -} - -type NullableCreateVPCNetworkRangePayload struct { - value *CreateVPCNetworkRangePayload - isSet bool -} - -func (v NullableCreateVPCNetworkRangePayload) Get() *CreateVPCNetworkRangePayload { - return v.value -} - -func (v *NullableCreateVPCNetworkRangePayload) Set(val *CreateVPCNetworkRangePayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateVPCNetworkRangePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateVPCNetworkRangePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateVPCNetworkRangePayload(val *CreateVPCNetworkRangePayload) *NullableCreateVPCNetworkRangePayload { - return &NullableCreateVPCNetworkRangePayload{value: val, isSet: true} -} - -func (v NullableCreateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateVPCNetworkRangePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_vpc_payload.go b/services/iaas/v2alpha1api/model_create_vpc_payload.go deleted file mode 100644 index ea4024d802..0000000000 --- a/services/iaas/v2alpha1api/model_create_vpc_payload.go +++ /dev/null @@ -1,244 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateVPCPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateVPCPayload{} - -// CreateVPCPayload Object that represents a create VPC request. -type CreateVPCPayload struct { - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - AdditionalProperties map[string]interface{} -} - -type _CreateVPCPayload CreateVPCPayload - -// NewCreateVPCPayload instantiates a new CreateVPCPayload 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 NewCreateVPCPayload(name string) *CreateVPCPayload { - this := CreateVPCPayload{} - this.Name = name - return &this -} - -// NewCreateVPCPayloadWithDefaults instantiates a new CreateVPCPayload 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 NewCreateVPCPayloadWithDefaults() *CreateVPCPayload { - this := CreateVPCPayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateVPCPayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *CreateVPCPayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateVPCPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreateVPCPayload) SetDescription(v string) { - o.Description = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateVPCPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *CreateVPCPayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateVPCPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *CreateVPCPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *CreateVPCPayload) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CreateVPCPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CreateVPCPayload) SetName(v string) { - o.Name = v -} - -func (o CreateVPCPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateVPCPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateVPCPayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateVPCPayload := _CreateVPCPayload{} - - err = json.Unmarshal(data, &varCreateVPCPayload) - - if err != nil { - return err - } - - *o = CreateVPCPayload(varCreateVPCPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateVPCPayload struct { - value *CreateVPCPayload - isSet bool -} - -func (v NullableCreateVPCPayload) Get() *CreateVPCPayload { - return v.value -} - -func (v *NullableCreateVPCPayload) Set(val *CreateVPCPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateVPCPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateVPCPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateVPCPayload(val *CreateVPCPayload) *NullableCreateVPCPayload { - return &NullableCreateVPCPayload{value: val, isSet: true} -} - -func (v NullableCreateVPCPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateVPCPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_vpc_region_payload.go b/services/iaas/v2alpha1api/model_create_vpc_region_payload.go deleted file mode 100644 index 8adc4d8298..0000000000 --- a/services/iaas/v2alpha1api/model_create_vpc_region_payload.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the CreateVPCRegionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateVPCRegionPayload{} - -// CreateVPCRegionPayload The basic properties of a regional VPC. -type CreateVPCRegionPayload struct { - Ipv4 *RegionalVPCIPv4 `json:"ipv4,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CreateVPCRegionPayload CreateVPCRegionPayload - -// NewCreateVPCRegionPayload instantiates a new CreateVPCRegionPayload 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 NewCreateVPCRegionPayload() *CreateVPCRegionPayload { - this := CreateVPCRegionPayload{} - return &this -} - -// NewCreateVPCRegionPayloadWithDefaults instantiates a new CreateVPCRegionPayload 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 NewCreateVPCRegionPayloadWithDefaults() *CreateVPCRegionPayload { - this := CreateVPCRegionPayload{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateVPCRegionPayload) GetIpv4() RegionalVPCIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret RegionalVPCIPv4 - return ret - } - return *o.Ipv4 -} - -// 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 *CreateVPCRegionPayload) GetIpv4Ok() (*RegionalVPCIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateVPCRegionPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given RegionalVPCIPv4 and assigns it to the Ipv4 field. -func (o *CreateVPCRegionPayload) SetIpv4(v RegionalVPCIPv4) { - o.Ipv4 = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateVPCRegionPayload) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *CreateVPCRegionPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *CreateVPCRegionPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateVPCRegionPayload) SetStatus(v string) { - o.Status = &v -} - -func (o CreateVPCRegionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateVPCRegionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateVPCRegionPayload) UnmarshalJSON(data []byte) (err error) { - varCreateVPCRegionPayload := _CreateVPCRegionPayload{} - - err = json.Unmarshal(data, &varCreateVPCRegionPayload) - - if err != nil { - return err - } - - *o = CreateVPCRegionPayload(varCreateVPCRegionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "ipv4") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateVPCRegionPayload struct { - value *CreateVPCRegionPayload - isSet bool -} - -func (v NullableCreateVPCRegionPayload) Get() *CreateVPCRegionPayload { - return v.value -} - -func (v *NullableCreateVPCRegionPayload) Set(val *CreateVPCRegionPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateVPCRegionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateVPCRegionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateVPCRegionPayload(val *CreateVPCRegionPayload) *NullableCreateVPCRegionPayload { - return &NullableCreateVPCRegionPayload{value: val, isSet: true} -} - -func (v NullableCreateVPCRegionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateVPCRegionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_destination_cidrv4.go b/services/iaas/v2alpha1api/model_destination_cidrv4.go deleted file mode 100644 index 7fa385304e..0000000000 --- a/services/iaas/v2alpha1api/model_destination_cidrv4.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the DestinationCIDRv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DestinationCIDRv4{} - -// DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. -type DestinationCIDRv4 struct { - Type string `json:"type"` - // An CIDRv4 string. - Value string `json:"value" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` - AdditionalProperties map[string]interface{} -} - -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 string, value string) *DestinationCIDRv4 { - this := DestinationCIDRv4{} - this.Type = types - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *DestinationCIDRv4) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *DestinationCIDRv4) SetType(v string) { - o.Type = v -} - -// GetValue returns the Value field value -func (o *DestinationCIDRv4) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *DestinationCIDRv4) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *DestinationCIDRv4) SetValue(v string) { - o.Value = v -} - -func (o DestinationCIDRv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["value"] = o.Value - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DestinationCIDRv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "value", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDestinationCIDRv4 := _DestinationCIDRv4{} - - err = json.Unmarshal(data, &varDestinationCIDRv4) - - if err != nil { - return err - } - - *o = DestinationCIDRv4(varDestinationCIDRv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDestinationCIDRv4 struct { - value *DestinationCIDRv4 - isSet bool -} - -func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { - return v.value -} - -func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { - v.value = val - v.isSet = true -} - -func (v NullableDestinationCIDRv4) IsSet() bool { - return v.isSet -} - -func (v *NullableDestinationCIDRv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { - return &NullableDestinationCIDRv4{value: val, isSet: true} -} - -func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_destination_cidrv6.go b/services/iaas/v2alpha1api/model_destination_cidrv6.go deleted file mode 100644 index 9d360e9ece..0000000000 --- a/services/iaas/v2alpha1api/model_destination_cidrv6.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the DestinationCIDRv6 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DestinationCIDRv6{} - -// DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. -type DestinationCIDRv6 struct { - Type string `json:"type"` - // An CIDRv6 string. - Value string `json:"value" validate:"regexp=^(([0-9a-fA-F]{1\\,4}:){7\\,7}[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,7}:|([0-9a-fA-F]{1\\,4}:){1\\,6}:[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,5}(:[0-9a-fA-F]{1\\,4}){1\\,2}|([0-9a-fA-F]{1\\,4}:){1\\,4}(:[0-9a-fA-F]{1\\,4}){1\\,3}|([0-9a-fA-F]{1\\,4}:){1\\,3}(:[0-9a-fA-F]{1\\,4}){1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,2}(:[0-9a-fA-F]{1\\,4}){1\\,5}|[0-9a-fA-F]{1\\,4}:((:[0-9a-fA-F]{1\\,4}){1\\,6})|:((:[0-9a-fA-F]{1\\,4}){1\\,7}|:)|fe80:(:[0-9a-fA-F]{0\\,4}){0\\,4}%[0-9a-zA-Z]{1\\,}|::(ffff(:0{1\\,4}){0\\,1}:){0\\,1}((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])|([0-9a-fA-F]{1\\,4}:){1\\,4}:((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9]))(/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - AdditionalProperties map[string]interface{} -} - -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 string, value string) *DestinationCIDRv6 { - this := DestinationCIDRv6{} - this.Type = types - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *DestinationCIDRv6) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *DestinationCIDRv6) SetType(v string) { - o.Type = v -} - -// GetValue returns the Value field value -func (o *DestinationCIDRv6) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *DestinationCIDRv6) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *DestinationCIDRv6) SetValue(v string) { - o.Value = v -} - -func (o DestinationCIDRv6) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["value"] = o.Value - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DestinationCIDRv6) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "value", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDestinationCIDRv6 := _DestinationCIDRv6{} - - err = json.Unmarshal(data, &varDestinationCIDRv6) - - if err != nil { - return err - } - - *o = DestinationCIDRv6(varDestinationCIDRv6) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDestinationCIDRv6 struct { - value *DestinationCIDRv6 - isSet bool -} - -func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { - return v.value -} - -func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { - v.value = val - v.isSet = true -} - -func (v NullableDestinationCIDRv6) IsSet() bool { - return v.isSet -} - -func (v *NullableDestinationCIDRv6) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { - return &NullableDestinationCIDRv6{value: val, isSet: true} -} - -func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_error.go b/services/iaas/v2alpha1api/model_error.go deleted file mode 100644 index c6f67bd97c..0000000000 --- a/services/iaas/v2alpha1api/model_error.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the Error type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Error{} - -// Error Error with HTTP error code and an error message. -type Error struct { - Code int64 `json:"code"` - // An error message. - Msg string `json:"msg"` - AdditionalProperties map[string]interface{} -} - -type _Error Error - -// NewError instantiates a new Error 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 NewError(code int64, msg string) *Error { - this := Error{} - this.Code = code - this.Msg = msg - return &this -} - -// NewErrorWithDefaults instantiates a new Error 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 NewErrorWithDefaults() *Error { - this := Error{} - return &this -} - -// GetCode returns the Code field value -func (o *Error) GetCode() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.Code -} - -// GetCodeOk returns a tuple with the Code field value -// and a boolean to check if the value has been set. -func (o *Error) GetCodeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.Code, true -} - -// SetCode sets field value -func (o *Error) SetCode(v int64) { - o.Code = v -} - -// GetMsg returns the Msg field value -func (o *Error) GetMsg() string { - if o == nil { - var ret string - return ret - } - - return o.Msg -} - -// GetMsgOk returns a tuple with the Msg field value -// and a boolean to check if the value has been set. -func (o *Error) GetMsgOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Msg, true -} - -// SetMsg sets field value -func (o *Error) SetMsg(v string) { - o.Msg = v -} - -func (o Error) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Error) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["code"] = o.Code - toSerialize["msg"] = o.Msg - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Error) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "code", - "msg", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varError := _Error{} - - err = json.Unmarshal(data, &varError) - - if err != nil { - return err - } - - *o = Error(varError) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "code") - delete(additionalProperties, "msg") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableError struct { - value *Error - isSet bool -} - -func (v NullableError) Get() *Error { - return v.value -} - -func (v *NullableError) Set(val *Error) { - v.value = val - v.isSet = true -} - -func (v NullableError) IsSet() bool { - return v.isSet -} - -func (v *NullableError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableError(val *Error) *NullableError { - return &NullableError{value: val, isSet: true} -} - -func (v NullableError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network.go b/services/iaas/v2alpha1api/model_network.go deleted file mode 100644 index f8b70ac321..0000000000 --- a/services/iaas/v2alpha1api/model_network.go +++ /dev/null @@ -1,568 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the Network type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Network{} - -// Network Object that represents a network. If no routing table is specified, the default routing table is used. -type Network struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Enable or disable DHCP for a network. - Dhcp *bool `json:"dhcp,omitempty"` - // Universally Unique Identifier (UUID). - Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - Ipv4 *NetworkIPv4 `json:"ipv4,omitempty"` - Ipv6 *NetworkIPv6 `json:"ipv6,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - Name string `json:"name"` - // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` - // Universally Unique Identifier (UUID). - RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status string `json:"status"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - // The identifier (ID) of a STACKIT VPC. - VpcId *string `json:"vpcId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -type _Network Network - -// NewNetwork instantiates a new Network 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 NewNetwork(id string, name string, status string) *Network { - this := Network{} - this.Id = id - this.Name = name - this.Status = status - return &this -} - -// NewNetworkWithDefaults instantiates a new Network 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 NewNetworkWithDefaults() *Network { - this := Network{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Network) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *Network) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Network) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Network) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDhcp returns the Dhcp field value if set, zero value otherwise. -func (o *Network) GetDhcp() bool { - if o == nil || IsNil(o.Dhcp) { - var ret bool - return ret - } - return *o.Dhcp -} - -// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetDhcpOk() (*bool, bool) { - if o == nil || IsNil(o.Dhcp) { - return nil, false - } - return o.Dhcp, true -} - -// HasDhcp returns a boolean if a field has been set. -func (o *Network) HasDhcp() bool { - if o != nil && !IsNil(o.Dhcp) { - return true - } - - return false -} - -// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. -func (o *Network) SetDhcp(v bool) { - o.Dhcp = &v -} - -// GetId returns the Id field value -func (o *Network) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Network) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Network) SetId(v string) { - o.Id = v -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *Network) GetIpv4() NetworkIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret NetworkIPv4 - return ret - } - return *o.Ipv4 -} - -// 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() (*NetworkIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *Network) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. -func (o *Network) SetIpv4(v NetworkIPv4) { - o.Ipv4 = &v -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *Network) GetIpv6() NetworkIPv6 { - if o == nil || IsNil(o.Ipv6) { - var ret NetworkIPv6 - return ret - } - return *o.Ipv6 -} - -// 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 *Network) GetIpv6Ok() (*NetworkIPv6, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *Network) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false -} - -// SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. -func (o *Network) SetIpv6(v NetworkIPv6) { - o.Ipv6 = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Network) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *Network) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *Network) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *Network) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *Network) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Network) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Network) SetName(v string) { - o.Name = v -} - -// GetRouted returns the Routed field value if set, zero value otherwise. -func (o *Network) GetRouted() bool { - if o == nil || IsNil(o.Routed) { - var ret bool - return ret - } - return *o.Routed -} - -// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true -} - -// HasRouted returns a boolean if a field has been set. -func (o *Network) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false -} - -// SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *Network) SetRouted(v bool) { - o.Routed = &v -} - -// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. -func (o *Network) GetRoutingTableId() string { - if o == nil || IsNil(o.RoutingTableId) { - var ret string - return ret - } - return *o.RoutingTableId -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.RoutingTableId) { - return nil, false - } - return o.RoutingTableId, true -} - -// HasRoutingTableId returns a boolean if a field has been set. -func (o *Network) HasRoutingTableId() bool { - if o != nil && !IsNil(o.RoutingTableId) { - return true - } - - return false -} - -// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. -func (o *Network) SetRoutingTableId(v string) { - o.RoutingTableId = &v -} - -// GetStatus returns the Status field value -func (o *Network) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Network) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Network) SetStatus(v string) { - o.Status = v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Network) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *Network) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Network) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Network) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -// GetVpcId returns the VpcId field value if set, zero value otherwise. -func (o *Network) GetVpcId() string { - if o == nil || IsNil(o.VpcId) { - var ret string - return ret - } - return *o.VpcId -} - -// GetVpcIdOk returns a tuple with the VpcId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetVpcIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcId) { - return nil, false - } - return o.VpcId, true -} - -// HasVpcId returns a boolean if a field has been set. -func (o *Network) HasVpcId() bool { - if o != nil && !IsNil(o.VpcId) { - return true - } - - return false -} - -// SetVpcId gets a reference to the given string and assigns it to the VpcId field. -func (o *Network) SetVpcId(v string) { - o.VpcId = &v -} - -func (o Network) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Network) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Dhcp) { - toSerialize["dhcp"] = o.Dhcp - } - toSerialize["id"] = o.Id - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed - } - if !IsNil(o.RoutingTableId) { - toSerialize["routingTableId"] = o.RoutingTableId - } - toSerialize["status"] = o.Status - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - if !IsNil(o.VpcId) { - toSerialize["vpcId"] = o.VpcId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Network) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "name", - "status", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNetwork := _Network{} - - err = json.Unmarshal(data, &varNetwork) - - if err != nil { - return err - } - - *o = Network(varNetwork) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "dhcp") - delete(additionalProperties, "id") - delete(additionalProperties, "ipv4") - delete(additionalProperties, "ipv6") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "routed") - delete(additionalProperties, "routingTableId") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - delete(additionalProperties, "vpcId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNetwork struct { - value *Network - isSet bool -} - -func (v NullableNetwork) Get() *Network { - return v.value -} - -func (v *NullableNetwork) Set(val *Network) { - v.value = val - v.isSet = true -} - -func (v NullableNetwork) IsSet() bool { - return v.isSet -} - -func (v *NullableNetwork) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetwork(val *Network) *NullableNetwork { - return &NullableNetwork{value: val, isSet: true} -} - -func (v NullableNetwork) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetwork) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network_ipv4.go b/services/iaas/v2alpha1api/model_network_ipv4.go deleted file mode 100644 index a154ef12d7..0000000000 --- a/services/iaas/v2alpha1api/model_network_ipv4.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkIPv4{} - -// NetworkIPv4 Object that represents the IPv4 part of a network. -type NetworkIPv4 struct { - // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - Prefixes []string `json:"prefixes"` - // String that represents an IPv4 address. - PublicIp *string `json:"publicIp,omitempty" validate:"regexp=^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 []string) *NetworkIPv4 { - this := NetworkIPv4{} - 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() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *NetworkIPv4) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *NetworkIPv4) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *NetworkIPv4) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *NetworkIPv4) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *NetworkIPv4) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *NetworkIPv4) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *NetworkIPv4) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefixes returns the Prefixes field value -func (o *NetworkIPv4) GetPrefixes() []string { - if o == nil { - var ret []string - return ret - } - - return o.Prefixes -} - -// GetPrefixesOk returns a tuple with the Prefixes field value -// and a boolean to check if the value has been set. -func (o *NetworkIPv4) GetPrefixesOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Prefixes, true -} - -// SetPrefixes sets field value -func (o *NetworkIPv4) SetPrefixes(v []string) { - o.Prefixes = v -} - -// GetPublicIp returns the PublicIp field value if set, zero value otherwise. -func (o *NetworkIPv4) GetPublicIp() string { - if o == nil || IsNil(o.PublicIp) { - var ret string - return ret - } - return *o.PublicIp -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.PublicIp) { - return nil, false - } - return o.PublicIp, true -} - -// HasPublicIp returns a boolean if a field has been set. -func (o *NetworkIPv4) HasPublicIp() bool { - if o != nil && !IsNil(o.PublicIp) { - return true - } - - return false -} - -// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. -func (o *NetworkIPv4) SetPublicIp(v string) { - o.PublicIp = &v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *NetworkIPv4) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NetworkIPv4) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *NetworkIPv4) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *NetworkIPv4) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o NetworkIPv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefixes"] = o.Prefixes - if !IsNil(o.PublicIp) { - toSerialize["publicIp"] = o.PublicIp - } - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NetworkIPv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefixes", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNetworkIPv4 := _NetworkIPv4{} - - err = json.Unmarshal(data, &varNetworkIPv4) - - if err != nil { - return err - } - - *o = NetworkIPv4(varNetworkIPv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefixes") - delete(additionalProperties, "publicIp") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNetworkIPv4 struct { - value *NetworkIPv4 - isSet bool -} - -func (v NullableNetworkIPv4) Get() *NetworkIPv4 { - return v.value -} - -func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { - return &NullableNetworkIPv4{value: val, isSet: true} -} - -func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network_ipv6.go b/services/iaas/v2alpha1api/model_network_ipv6.go deleted file mode 100644 index c916696b41..0000000000 --- a/services/iaas/v2alpha1api/model_network_ipv6.go +++ /dev/null @@ -1,292 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkIPv6{} - -// NetworkIPv6 Object that represents the IPv6 part of a network. -type NetworkIPv6 struct { - // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9a-f]{1\\,4}:){7}([0-9a-f]{1\\,4}|:))|(([0-9a-f]{1\\,4}:){6}(:[0-9a-f]{1\\,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){5}(((:[0-9a-f]{1\\,4}){1\\,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){4}(((:[0-9a-f]{1\\,4}){1\\,3})|((:[0-9a-f]{1\\,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){3}(((:[0-9a-f]{1\\,4}){1\\,4})|((:[0-9a-f]{1\\,4}){0\\,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){2}(((:[0-9a-f]{1\\,4}){1\\,5})|((:[0-9a-f]{1\\,4}){0\\,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){1}(((:[0-9a-f]{1\\,4}){1\\,6})|((:[0-9a-f]{1\\,4}){0\\,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1\\,4}){1\\,7})|((:[0-9a-f]{1\\,4}){0\\,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"` - // A list containing DNS Servers/Nameservers for IPv6. - Nameservers []string `json:"nameservers,omitempty"` - Prefixes []string `json:"prefixes"` - // Universally Unique Identifier (UUID). - VpcNetworkRangeId *string `json:"vpcNetworkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -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 []string) *NetworkIPv6 { - this := NetworkIPv6{} - 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() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *NetworkIPv6) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *NetworkIPv6) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *NetworkIPv6) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *NetworkIPv6) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *NetworkIPv6) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *NetworkIPv6) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *NetworkIPv6) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefixes returns the Prefixes field value -func (o *NetworkIPv6) GetPrefixes() []string { - if o == nil { - var ret []string - return ret - } - - return o.Prefixes -} - -// GetPrefixesOk returns a tuple with the Prefixes field value -// and a boolean to check if the value has been set. -func (o *NetworkIPv6) GetPrefixesOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Prefixes, true -} - -// SetPrefixes sets field value -func (o *NetworkIPv6) SetPrefixes(v []string) { - o.Prefixes = v -} - -// GetVpcNetworkRangeId returns the VpcNetworkRangeId field value if set, zero value otherwise. -func (o *NetworkIPv6) GetVpcNetworkRangeId() string { - if o == nil || IsNil(o.VpcNetworkRangeId) { - var ret string - return ret - } - return *o.VpcNetworkRangeId -} - -// GetVpcNetworkRangeIdOk returns a tuple with the VpcNetworkRangeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NetworkIPv6) GetVpcNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.VpcNetworkRangeId) { - return nil, false - } - return o.VpcNetworkRangeId, true -} - -// HasVpcNetworkRangeId returns a boolean if a field has been set. -func (o *NetworkIPv6) HasVpcNetworkRangeId() bool { - if o != nil && !IsNil(o.VpcNetworkRangeId) { - return true - } - - return false -} - -// SetVpcNetworkRangeId gets a reference to the given string and assigns it to the VpcNetworkRangeId field. -func (o *NetworkIPv6) SetVpcNetworkRangeId(v string) { - o.VpcNetworkRangeId = &v -} - -func (o NetworkIPv6) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefixes"] = o.Prefixes - if !IsNil(o.VpcNetworkRangeId) { - toSerialize["vpcNetworkRangeId"] = o.VpcNetworkRangeId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NetworkIPv6) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "prefixes", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNetworkIPv6 := _NetworkIPv6{} - - err = json.Unmarshal(data, &varNetworkIPv6) - - if err != nil { - return err - } - - *o = NetworkIPv6(varNetworkIPv6) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefixes") - delete(additionalProperties, "vpcNetworkRangeId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNetworkIPv6 struct { - value *NetworkIPv6 - isSet bool -} - -func (v NullableNetworkIPv6) Get() *NetworkIPv6 { - return v.value -} - -func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkIPv6) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkIPv6) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { - return &NullableNetworkIPv6{value: val, isSet: true} -} - -func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network_list_response.go b/services/iaas/v2alpha1api/model_network_list_response.go deleted file mode 100644 index cbeeb2906e..0000000000 --- a/services/iaas/v2alpha1api/model_network_list_response.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkListResponse{} - -// NetworkListResponse Network list response. -type NetworkListResponse struct { - // A list of networks. - Items []Network `json:"items"` - AdditionalProperties map[string]interface{} -} - -type _NetworkListResponse NetworkListResponse - -// NewNetworkListResponse instantiates a new NetworkListResponse 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 NewNetworkListResponse(items []Network) *NetworkListResponse { - this := NetworkListResponse{} - this.Items = items - return &this -} - -// NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse 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 NewNetworkListResponseWithDefaults() *NetworkListResponse { - this := NetworkListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *NetworkListResponse) GetItems() []Network { - if o == nil { - var ret []Network - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *NetworkListResponse) GetItemsOk() ([]Network, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *NetworkListResponse) SetItems(v []Network) { - o.Items = v -} - -func (o NetworkListResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NetworkListResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNetworkListResponse := _NetworkListResponse{} - - err = json.Unmarshal(data, &varNetworkListResponse) - - if err != nil { - return err - } - - *o = NetworkListResponse(varNetworkListResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNetworkListResponse struct { - value *NetworkListResponse - isSet bool -} - -func (v NullableNetworkListResponse) Get() *NetworkListResponse { - return v.value -} - -func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { - return &NullableNetworkListResponse{value: val, isSet: true} -} - -func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network_range_ipv4_request.go b/services/iaas/v2alpha1api/model_network_range_ipv4_request.go deleted file mode 100644 index 8bb847b526..0000000000 --- a/services/iaas/v2alpha1api/model_network_range_ipv4_request.go +++ /dev/null @@ -1,437 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NetworkRangeIPv4Request type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NetworkRangeIPv4Request{} - -// NetworkRangeIPv4Request Contains the IPv4 properties of a VPC network range request. Filterable Fields: `defaultPrefixLen`, `maxPrefixLen`, `minPrefixLen`, `nameservers`, `prefix`. -type NetworkRangeIPv4Request struct { - // The default prefix length for network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - IpVersion NetworkRangeIPv4RequestIpVersion `json:"ipVersion"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The maximal prefix length for network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR). - Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1\\,4}:){7\\,7}[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,7}:|([0-9a-fA-F]{1\\,4}:){1\\,6}:[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,5}(:[0-9a-fA-F]{1\\,4}){1\\,2}|([0-9a-fA-F]{1\\,4}:){1\\,4}(:[0-9a-fA-F]{1\\,4}){1\\,3}|([0-9a-fA-F]{1\\,4}:){1\\,3}(:[0-9a-fA-F]{1\\,4}){1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,2}(:[0-9a-fA-F]{1\\,4}){1\\,5}|[0-9a-fA-F]{1\\,4}:((:[0-9a-fA-F]{1\\,4}){1\\,6})|:((:[0-9a-fA-F]{1\\,4}){1\\,7}|:)|fe80:(:[0-9a-fA-F]{0\\,4}){0\\,4}%[0-9a-zA-Z]{1\\,}|::(ffff(:0{1\\,4}){0\\,1}:){0\\,1}((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])|([0-9a-fA-F]{1\\,4}:){1\\,4}:((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9]))(/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - AdditionalProperties map[string]interface{} -} - -type _NetworkRangeIPv4Request NetworkRangeIPv4Request - -// NewNetworkRangeIPv4Request instantiates a new NetworkRangeIPv4Request 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 NewNetworkRangeIPv4Request(ipVersion NetworkRangeIPv4RequestIpVersion, prefix string) *NetworkRangeIPv4Request { - this := NetworkRangeIPv4Request{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - this.IpVersion = ipVersion - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - this.Prefix = prefix - return &this -} - -// NewNetworkRangeIPv4RequestWithDefaults instantiates a new NetworkRangeIPv4Request 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 NewNetworkRangeIPv4RequestWithDefaults() *NetworkRangeIPv4Request { - this := NetworkRangeIPv4Request{} - 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 *NetworkRangeIPv4Request) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen -} - -// 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 *NetworkRangeIPv4Request) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *NetworkRangeIPv4Request) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *NetworkRangeIPv4Request) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *NetworkRangeIPv4Request) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *NetworkRangeIPv4Request) SetDescription(v string) { - o.Description = &v -} - -// GetIpVersion returns the IpVersion field value -func (o *NetworkRangeIPv4Request) GetIpVersion() NetworkRangeIPv4RequestIpVersion { - if o == nil { - var ret NetworkRangeIPv4RequestIpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *NetworkRangeIPv4Request) GetIpVersionOk() (*NetworkRangeIPv4RequestIpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *NetworkRangeIPv4Request) SetIpVersion(v NetworkRangeIPv4RequestIpVersion) { - o.IpVersion = v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *NetworkRangeIPv4Request) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *NetworkRangeIPv4Request) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *NetworkRangeIPv4Request) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *NetworkRangeIPv4Request) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// 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 *NetworkRangeIPv4Request) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *NetworkRangeIPv4Request) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *NetworkRangeIPv4Request) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// 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 *NetworkRangeIPv4Request) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *NetworkRangeIPv4Request) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *NetworkRangeIPv4Request) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *NetworkRangeIPv4Request) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *NetworkRangeIPv4Request) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *NetworkRangeIPv4Request) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *NetworkRangeIPv4Request) GetPrefix() string { - if o == nil { - var ret string - return ret - } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *NetworkRangeIPv4Request) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Prefix, true -} - -// SetPrefix sets field value -func (o *NetworkRangeIPv4Request) SetPrefix(v string) { - o.Prefix = v -} - -func (o NetworkRangeIPv4Request) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NetworkRangeIPv4Request) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NetworkRangeIPv4Request) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNetworkRangeIPv4Request := _NetworkRangeIPv4Request{} - - err = json.Unmarshal(data, &varNetworkRangeIPv4Request) - - if err != nil { - return err - } - - *o = NetworkRangeIPv4Request(varNetworkRangeIPv4Request) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "description") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "labels") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNetworkRangeIPv4Request struct { - value *NetworkRangeIPv4Request - isSet bool -} - -func (v NullableNetworkRangeIPv4Request) Get() *NetworkRangeIPv4Request { - return v.value -} - -func (v *NullableNetworkRangeIPv4Request) Set(val *NetworkRangeIPv4Request) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkRangeIPv4Request) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkRangeIPv4Request) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkRangeIPv4Request(val *NetworkRangeIPv4Request) *NullableNetworkRangeIPv4Request { - return &NullableNetworkRangeIPv4Request{value: val, isSet: true} -} - -func (v NullableNetworkRangeIPv4Request) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkRangeIPv4Request) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_network_range_ipv4_request_ip_version.go b/services/iaas/v2alpha1api/model_network_range_ipv4_request_ip_version.go deleted file mode 100644 index 87b88789a5..0000000000 --- a/services/iaas/v2alpha1api/model_network_range_ipv4_request_ip_version.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// NetworkRangeIPv4RequestIpVersion the model 'NetworkRangeIPv4RequestIpVersion' -type NetworkRangeIPv4RequestIpVersion string - -// List of NetworkRangeIPv4Request_ipVersion -const ( - NETWORKRANGEIPV4REQUESTIPVERSION_IPV4 NetworkRangeIPv4RequestIpVersion = "ipv4" - NETWORKRANGEIPV4REQUESTIPVERSION_UNKNOWN_DEFAULT_OPEN_API NetworkRangeIPv4RequestIpVersion = "unknown_default_open_api" -) - -// All allowed values of NetworkRangeIPv4RequestIpVersion enum -var AllowedNetworkRangeIPv4RequestIpVersionEnumValues = []NetworkRangeIPv4RequestIpVersion{ - "ipv4", - "unknown_default_open_api", -} - -func (v *NetworkRangeIPv4RequestIpVersion) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := NetworkRangeIPv4RequestIpVersion(value) - for _, existing := range AllowedNetworkRangeIPv4RequestIpVersionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = NETWORKRANGEIPV4REQUESTIPVERSION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewNetworkRangeIPv4RequestIpVersionFromValue returns a pointer to a valid NetworkRangeIPv4RequestIpVersion -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewNetworkRangeIPv4RequestIpVersionFromValue(v string) (*NetworkRangeIPv4RequestIpVersion, error) { - ev := NetworkRangeIPv4RequestIpVersion(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for NetworkRangeIPv4RequestIpVersion: valid values are %v", v, AllowedNetworkRangeIPv4RequestIpVersionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v NetworkRangeIPv4RequestIpVersion) IsValid() bool { - for _, existing := range AllowedNetworkRangeIPv4RequestIpVersionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to NetworkRangeIPv4Request_ipVersion value -func (v NetworkRangeIPv4RequestIpVersion) Ptr() *NetworkRangeIPv4RequestIpVersion { - return &v -} - -type NullableNetworkRangeIPv4RequestIpVersion struct { - value *NetworkRangeIPv4RequestIpVersion - isSet bool -} - -func (v NullableNetworkRangeIPv4RequestIpVersion) Get() *NetworkRangeIPv4RequestIpVersion { - return v.value -} - -func (v *NullableNetworkRangeIPv4RequestIpVersion) Set(val *NetworkRangeIPv4RequestIpVersion) { - v.value = val - v.isSet = true -} - -func (v NullableNetworkRangeIPv4RequestIpVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableNetworkRangeIPv4RequestIpVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNetworkRangeIPv4RequestIpVersion(val *NetworkRangeIPv4RequestIpVersion) *NullableNetworkRangeIPv4RequestIpVersion { - return &NullableNetworkRangeIPv4RequestIpVersion{value: val, isSet: true} -} - -func (v NullableNetworkRangeIPv4RequestIpVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNetworkRangeIPv4RequestIpVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_nexthop_blackhole.go b/services/iaas/v2alpha1api/model_nexthop_blackhole.go deleted file mode 100644 index 98543e9d15..0000000000 --- a/services/iaas/v2alpha1api/model_nexthop_blackhole.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NexthopBlackhole type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NexthopBlackhole{} - -// NexthopBlackhole Object that represents a blackhole route. -type NexthopBlackhole struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -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 string) *NexthopBlackhole { - this := NexthopBlackhole{} - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *NexthopBlackhole) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *NexthopBlackhole) SetType(v string) { - o.Type = v -} - -func (o NexthopBlackhole) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NexthopBlackhole) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNexthopBlackhole := _NexthopBlackhole{} - - err = json.Unmarshal(data, &varNexthopBlackhole) - - if err != nil { - return err - } - - *o = NexthopBlackhole(varNexthopBlackhole) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNexthopBlackhole struct { - value *NexthopBlackhole - isSet bool -} - -func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { - return v.value -} - -func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { - v.value = val - v.isSet = true -} - -func (v NullableNexthopBlackhole) IsSet() bool { - return v.isSet -} - -func (v *NullableNexthopBlackhole) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { - return &NullableNexthopBlackhole{value: val, isSet: true} -} - -func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_nexthop_internet.go b/services/iaas/v2alpha1api/model_nexthop_internet.go deleted file mode 100644 index a3c6760fdd..0000000000 --- a/services/iaas/v2alpha1api/model_nexthop_internet.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NexthopInternet type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NexthopInternet{} - -// NexthopInternet Object that represents a route to the internet. -type NexthopInternet struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -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 string) *NexthopInternet { - this := NexthopInternet{} - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *NexthopInternet) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *NexthopInternet) SetType(v string) { - o.Type = v -} - -func (o NexthopInternet) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NexthopInternet) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NexthopInternet) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNexthopInternet := _NexthopInternet{} - - err = json.Unmarshal(data, &varNexthopInternet) - - if err != nil { - return err - } - - *o = NexthopInternet(varNexthopInternet) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNexthopInternet struct { - value *NexthopInternet - isSet bool -} - -func (v NullableNexthopInternet) Get() *NexthopInternet { - return v.value -} - -func (v *NullableNexthopInternet) Set(val *NexthopInternet) { - v.value = val - v.isSet = true -} - -func (v NullableNexthopInternet) IsSet() bool { - return v.isSet -} - -func (v *NullableNexthopInternet) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { - return &NullableNexthopInternet{value: val, isSet: true} -} - -func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_nexthop_ipv4.go b/services/iaas/v2alpha1api/model_nexthop_ipv4.go deleted file mode 100644 index 2c57966c20..0000000000 --- a/services/iaas/v2alpha1api/model_nexthop_ipv4.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NexthopIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NexthopIPv4{} - -// NexthopIPv4 Object that represents an IPv4 address. -type NexthopIPv4 struct { - Type string `json:"type"` - // An IPv4 address. - Value string `json:"value" validate:"regexp=^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$"` - AdditionalProperties map[string]interface{} -} - -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 string, value string) *NexthopIPv4 { - this := NexthopIPv4{} - this.Type = types - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *NexthopIPv4) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *NexthopIPv4) SetType(v string) { - o.Type = v -} - -// GetValue returns the Value field value -func (o *NexthopIPv4) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *NexthopIPv4) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *NexthopIPv4) SetValue(v string) { - o.Value = v -} - -func (o NexthopIPv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["value"] = o.Value - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NexthopIPv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "value", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNexthopIPv4 := _NexthopIPv4{} - - err = json.Unmarshal(data, &varNexthopIPv4) - - if err != nil { - return err - } - - *o = NexthopIPv4(varNexthopIPv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNexthopIPv4 struct { - value *NexthopIPv4 - isSet bool -} - -func (v NullableNexthopIPv4) Get() *NexthopIPv4 { - return v.value -} - -func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableNexthopIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableNexthopIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { - return &NullableNexthopIPv4{value: val, isSet: true} -} - -func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_nexthop_ipv6.go b/services/iaas/v2alpha1api/model_nexthop_ipv6.go deleted file mode 100644 index 3c73d303d3..0000000000 --- a/services/iaas/v2alpha1api/model_nexthop_ipv6.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the NexthopIPv6 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NexthopIPv6{} - -// NexthopIPv6 Object that represents an IPv6 address. -type NexthopIPv6 struct { - Type string `json:"type"` - // An IPv6 address. - Value string `json:"value" validate:"regexp=^\\s*((([0-9a-f]{1\\,4}:){7}([0-9a-f]{1\\,4}|:))|(([0-9a-f]{1\\,4}:){6}(:[0-9a-f]{1\\,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){5}(((:[0-9a-f]{1\\,4}){1\\,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){4}(((:[0-9a-f]{1\\,4}){1\\,3})|((:[0-9a-f]{1\\,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){3}(((:[0-9a-f]{1\\,4}){1\\,4})|((:[0-9a-f]{1\\,4}){0\\,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){2}(((:[0-9a-f]{1\\,4}){1\\,5})|((:[0-9a-f]{1\\,4}){0\\,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){1}(((:[0-9a-f]{1\\,4}){1\\,6})|((:[0-9a-f]{1\\,4}){0\\,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1\\,4}){1\\,7})|((:[0-9a-f]{1\\,4}){0\\,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"` - AdditionalProperties map[string]interface{} -} - -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 string, value string) *NexthopIPv6 { - this := NexthopIPv6{} - this.Type = types - 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() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *NexthopIPv6) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *NexthopIPv6) SetType(v string) { - o.Type = v -} - -// GetValue returns the Value field value -func (o *NexthopIPv6) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *NexthopIPv6) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *NexthopIPv6) SetValue(v string) { - o.Value = v -} - -func (o NexthopIPv6) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["value"] = o.Value - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *NexthopIPv6) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "value", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varNexthopIPv6 := _NexthopIPv6{} - - err = json.Unmarshal(data, &varNexthopIPv6) - - if err != nil { - return err - } - - *o = NexthopIPv6(varNexthopIPv6) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNexthopIPv6 struct { - value *NexthopIPv6 - isSet bool -} - -func (v NullableNexthopIPv6) Get() *NexthopIPv6 { - return v.value -} - -func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { - v.value = val - v.isSet = true -} - -func (v NullableNexthopIPv6) IsSet() bool { - return v.isSet -} - -func (v *NullableNexthopIPv6) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { - return &NullableNexthopIPv6{value: val, isSet: true} -} - -func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_partial_update_network_payload.go b/services/iaas/v2alpha1api/model_partial_update_network_payload.go deleted file mode 100644 index d62ff4960f..0000000000 --- a/services/iaas/v2alpha1api/model_partial_update_network_payload.go +++ /dev/null @@ -1,381 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PartialUpdateNetworkPayload{} - -// PartialUpdateNetworkPayload Object that represents the request body for a network update. -type PartialUpdateNetworkPayload struct { - // Enable or disable DHCP for a network. - Dhcp *bool `json:"dhcp,omitempty"` - Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` - Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` - // Universally Unique Identifier (UUID). - RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - AdditionalProperties map[string]interface{} -} - -type _PartialUpdateNetworkPayload PartialUpdateNetworkPayload - -// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload 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 NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { - this := PartialUpdateNetworkPayload{} - return &this -} - -// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload 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 NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { - this := PartialUpdateNetworkPayload{} - return &this -} - -// GetDhcp returns the Dhcp field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetDhcp() bool { - if o == nil || IsNil(o.Dhcp) { - var ret bool - return ret - } - return *o.Dhcp -} - -// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetDhcpOk() (*bool, bool) { - if o == nil || IsNil(o.Dhcp) { - return nil, false - } - return o.Dhcp, true -} - -// HasDhcp returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasDhcp() bool { - if o != nil && !IsNil(o.Dhcp) { - return true - } - - return false -} - -// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. -func (o *PartialUpdateNetworkPayload) SetDhcp(v bool) { - o.Dhcp = &v -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetIpv4() UpdateNetworkIPv4Body { - if o == nil || IsNil(o.Ipv4) { - var ret UpdateNetworkIPv4Body - return ret - } - return *o.Ipv4 -} - -// 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() (*UpdateNetworkIPv4Body, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. -func (o *PartialUpdateNetworkPayload) SetIpv4(v UpdateNetworkIPv4Body) { - o.Ipv4 = &v -} - -// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetIpv6() UpdateNetworkIPv6Body { - if o == nil || IsNil(o.Ipv6) { - var ret UpdateNetworkIPv6Body - return ret - } - return *o.Ipv6 -} - -// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true -} - -// HasIpv6 returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false -} - -// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. -func (o *PartialUpdateNetworkPayload) SetIpv6(v UpdateNetworkIPv6Body) { - o.Ipv6 = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *PartialUpdateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *PartialUpdateNetworkPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// 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 *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *PartialUpdateNetworkPayload) SetName(v string) { - o.Name = &v -} - -// GetRouted returns the Routed field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetRouted() bool { - if o == nil || IsNil(o.Routed) { - var ret bool - return ret - } - return *o.Routed -} - -// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true -} - -// HasRouted returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false -} - -// SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *PartialUpdateNetworkPayload) SetRouted(v bool) { - o.Routed = &v -} - -// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetRoutingTableId() string { - if o == nil || IsNil(o.RoutingTableId) { - var ret string - return ret - } - return *o.RoutingTableId -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.RoutingTableId) { - return nil, false - } - return o.RoutingTableId, true -} - -// HasRoutingTableId returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { - if o != nil && !IsNil(o.RoutingTableId) { - return true - } - - return false -} - -// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. -func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v string) { - o.RoutingTableId = &v -} - -func (o PartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Dhcp) { - toSerialize["dhcp"] = o.Dhcp - } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed - } - if !IsNil(o.RoutingTableId) { - toSerialize["routingTableId"] = o.RoutingTableId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PartialUpdateNetworkPayload) UnmarshalJSON(data []byte) (err error) { - varPartialUpdateNetworkPayload := _PartialUpdateNetworkPayload{} - - err = json.Unmarshal(data, &varPartialUpdateNetworkPayload) - - if err != nil { - return err - } - - *o = PartialUpdateNetworkPayload(varPartialUpdateNetworkPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "dhcp") - delete(additionalProperties, "ipv4") - delete(additionalProperties, "ipv6") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "routed") - delete(additionalProperties, "routingTableId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePartialUpdateNetworkPayload struct { - value *PartialUpdateNetworkPayload - isSet bool -} - -func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { - return v.value -} - -func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateNetworkPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateNetworkPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { - return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} -} - -func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_partial_update_vpc_payload.go b/services/iaas/v2alpha1api/model_partial_update_vpc_payload.go deleted file mode 100644 index 3b45029b45..0000000000 --- a/services/iaas/v2alpha1api/model_partial_update_vpc_payload.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the PartialUpdateVPCPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PartialUpdateVPCPayload{} - -// PartialUpdateVPCPayload Object that represents a update VPC request. -type PartialUpdateVPCPayload struct { - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - AdditionalProperties map[string]interface{} -} - -type _PartialUpdateVPCPayload PartialUpdateVPCPayload - -// NewPartialUpdateVPCPayload instantiates a new PartialUpdateVPCPayload 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 NewPartialUpdateVPCPayload() *PartialUpdateVPCPayload { - this := PartialUpdateVPCPayload{} - return &this -} - -// NewPartialUpdateVPCPayloadWithDefaults instantiates a new PartialUpdateVPCPayload 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 NewPartialUpdateVPCPayloadWithDefaults() *PartialUpdateVPCPayload { - this := PartialUpdateVPCPayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *PartialUpdateVPCPayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *PartialUpdateVPCPayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *PartialUpdateVPCPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *PartialUpdateVPCPayload) SetDescription(v string) { - o.Description = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateVPCPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *PartialUpdateVPCPayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *PartialUpdateVPCPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *PartialUpdateVPCPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateVPCPayload) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// 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 *PartialUpdateVPCPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *PartialUpdateVPCPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *PartialUpdateVPCPayload) SetName(v string) { - o.Name = &v -} - -func (o PartialUpdateVPCPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PartialUpdateVPCPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PartialUpdateVPCPayload) UnmarshalJSON(data []byte) (err error) { - varPartialUpdateVPCPayload := _PartialUpdateVPCPayload{} - - err = json.Unmarshal(data, &varPartialUpdateVPCPayload) - - if err != nil { - return err - } - - *o = PartialUpdateVPCPayload(varPartialUpdateVPCPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePartialUpdateVPCPayload struct { - value *PartialUpdateVPCPayload - isSet bool -} - -func (v NullablePartialUpdateVPCPayload) Get() *PartialUpdateVPCPayload { - return v.value -} - -func (v *NullablePartialUpdateVPCPayload) Set(val *PartialUpdateVPCPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateVPCPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateVPCPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateVPCPayload(val *PartialUpdateVPCPayload) *NullablePartialUpdateVPCPayload { - return &NullablePartialUpdateVPCPayload{value: val, isSet: true} -} - -func (v NullablePartialUpdateVPCPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateVPCPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_regional_vpc.go b/services/iaas/v2alpha1api/model_regional_vpc.go deleted file mode 100644 index 32774e397f..0000000000 --- a/services/iaas/v2alpha1api/model_regional_vpc.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the RegionalVPC type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RegionalVPC{} - -// RegionalVPC The basic properties of a regional VPC. -type RegionalVPC struct { - Ipv4 *RegionalVPCIPv4 `json:"ipv4,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _RegionalVPC RegionalVPC - -// NewRegionalVPC instantiates a new RegionalVPC 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 NewRegionalVPC() *RegionalVPC { - this := RegionalVPC{} - return &this -} - -// NewRegionalVPCWithDefaults instantiates a new RegionalVPC 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 NewRegionalVPCWithDefaults() *RegionalVPC { - this := RegionalVPC{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *RegionalVPC) GetIpv4() RegionalVPCIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret RegionalVPCIPv4 - return ret - } - return *o.Ipv4 -} - -// 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 *RegionalVPC) GetIpv4Ok() (*RegionalVPCIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *RegionalVPC) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given RegionalVPCIPv4 and assigns it to the Ipv4 field. -func (o *RegionalVPC) SetIpv4(v RegionalVPCIPv4) { - o.Ipv4 = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *RegionalVPC) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *RegionalVPC) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *RegionalVPC) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *RegionalVPC) SetStatus(v string) { - o.Status = &v -} - -func (o RegionalVPC) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RegionalVPC) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RegionalVPC) UnmarshalJSON(data []byte) (err error) { - varRegionalVPC := _RegionalVPC{} - - err = json.Unmarshal(data, &varRegionalVPC) - - if err != nil { - return err - } - - *o = RegionalVPC(varRegionalVPC) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "ipv4") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRegionalVPC struct { - value *RegionalVPC - isSet bool -} - -func (v NullableRegionalVPC) Get() *RegionalVPC { - return v.value -} - -func (v *NullableRegionalVPC) Set(val *RegionalVPC) { - v.value = val - v.isSet = true -} - -func (v NullableRegionalVPC) IsSet() bool { - return v.isSet -} - -func (v *NullableRegionalVPC) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRegionalVPC(val *RegionalVPC) *NullableRegionalVPC { - return &NullableRegionalVPC{value: val, isSet: true} -} - -func (v NullableRegionalVPC) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRegionalVPC) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_regional_vpc_list.go b/services/iaas/v2alpha1api/model_regional_vpc_list.go deleted file mode 100644 index 729e72a3bc..0000000000 --- a/services/iaas/v2alpha1api/model_regional_vpc_list.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the RegionalVPCList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RegionalVPCList{} - -// RegionalVPCList Regional VPC list response. -type RegionalVPCList struct { - Regions map[string]RegionalVPC `json:"regions"` - AdditionalProperties map[string]interface{} -} - -type _RegionalVPCList RegionalVPCList - -// NewRegionalVPCList instantiates a new RegionalVPCList 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 NewRegionalVPCList(regions map[string]RegionalVPC) *RegionalVPCList { - this := RegionalVPCList{} - this.Regions = regions - return &this -} - -// NewRegionalVPCListWithDefaults instantiates a new RegionalVPCList 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 NewRegionalVPCListWithDefaults() *RegionalVPCList { - this := RegionalVPCList{} - return &this -} - -// GetRegions returns the Regions field value -func (o *RegionalVPCList) GetRegions() map[string]RegionalVPC { - if o == nil { - var ret map[string]RegionalVPC - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *RegionalVPCList) GetRegionsOk() (*map[string]RegionalVPC, bool) { - if o == nil { - return nil, false - } - return &o.Regions, true -} - -// SetRegions sets field value -func (o *RegionalVPCList) SetRegions(v map[string]RegionalVPC) { - o.Regions = v -} - -func (o RegionalVPCList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RegionalVPCList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["regions"] = o.Regions - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RegionalVPCList) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "regions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRegionalVPCList := _RegionalVPCList{} - - err = json.Unmarshal(data, &varRegionalVPCList) - - if err != nil { - return err - } - - *o = RegionalVPCList(varRegionalVPCList) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "regions") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRegionalVPCList struct { - value *RegionalVPCList - isSet bool -} - -func (v NullableRegionalVPCList) Get() *RegionalVPCList { - return v.value -} - -func (v *NullableRegionalVPCList) Set(val *RegionalVPCList) { - v.value = val - v.isSet = true -} - -func (v NullableRegionalVPCList) IsSet() bool { - return v.isSet -} - -func (v *NullableRegionalVPCList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRegionalVPCList(val *RegionalVPCList) *NullableRegionalVPCList { - return &NullableRegionalVPCList{value: val, isSet: true} -} - -func (v NullableRegionalVPCList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRegionalVPCList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_regional_vpcipv4.go b/services/iaas/v2alpha1api/model_regional_vpcipv4.go deleted file mode 100644 index 80982be6d3..0000000000 --- a/services/iaas/v2alpha1api/model_regional_vpcipv4.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the RegionalVPCIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RegionalVPCIPv4{} - -// RegionalVPCIPv4 The regional IPv4 config of a VPC. -type RegionalVPCIPv4 struct { - DefaultNameservers []string `json:"defaultNameservers"` - AdditionalProperties map[string]interface{} -} - -type _RegionalVPCIPv4 RegionalVPCIPv4 - -// NewRegionalVPCIPv4 instantiates a new RegionalVPCIPv4 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 NewRegionalVPCIPv4(defaultNameservers []string) *RegionalVPCIPv4 { - this := RegionalVPCIPv4{} - this.DefaultNameservers = defaultNameservers - return &this -} - -// NewRegionalVPCIPv4WithDefaults instantiates a new RegionalVPCIPv4 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 NewRegionalVPCIPv4WithDefaults() *RegionalVPCIPv4 { - this := RegionalVPCIPv4{} - return &this -} - -// GetDefaultNameservers returns the DefaultNameservers field value -func (o *RegionalVPCIPv4) GetDefaultNameservers() []string { - if o == nil { - var ret []string - return ret - } - - return o.DefaultNameservers -} - -// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value -// and a boolean to check if the value has been set. -func (o *RegionalVPCIPv4) GetDefaultNameserversOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.DefaultNameservers, true -} - -// SetDefaultNameservers sets field value -func (o *RegionalVPCIPv4) SetDefaultNameservers(v []string) { - o.DefaultNameservers = v -} - -func (o RegionalVPCIPv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RegionalVPCIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["defaultNameservers"] = o.DefaultNameservers - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RegionalVPCIPv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "defaultNameservers", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRegionalVPCIPv4 := _RegionalVPCIPv4{} - - err = json.Unmarshal(data, &varRegionalVPCIPv4) - - if err != nil { - return err - } - - *o = RegionalVPCIPv4(varRegionalVPCIPv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "defaultNameservers") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRegionalVPCIPv4 struct { - value *RegionalVPCIPv4 - isSet bool -} - -func (v NullableRegionalVPCIPv4) Get() *RegionalVPCIPv4 { - return v.value -} - -func (v *NullableRegionalVPCIPv4) Set(val *RegionalVPCIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableRegionalVPCIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableRegionalVPCIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRegionalVPCIPv4(val *RegionalVPCIPv4) *NullableRegionalVPCIPv4 { - return &NullableRegionalVPCIPv4{value: val, isSet: true} -} - -func (v NullableRegionalVPCIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRegionalVPCIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_route.go b/services/iaas/v2alpha1api/model_route.go deleted file mode 100644 index 376949f2d1..0000000000 --- a/services/iaas/v2alpha1api/model_route.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the Route type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Route{} - -// Route Object represents a network route. -type Route struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - Destination RouteDestination `json:"destination"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - Nexthop RouteNexthop `json:"nexthop"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Route Route - -// NewRoute instantiates a new Route 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 NewRoute(destination RouteDestination, nexthop RouteNexthop) *Route { - this := Route{} - this.Destination = destination - this.Nexthop = nexthop - return &this -} - -// NewRouteWithDefaults instantiates a new Route 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 NewRouteWithDefaults() *Route { - this := Route{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Route) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *Route) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *Route) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Route) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDestination returns the Destination field value -func (o *Route) GetDestination() RouteDestination { - if o == nil { - var ret RouteDestination - return ret - } - - return o.Destination -} - -// GetDestinationOk returns a tuple with the Destination field value -// and a boolean to check if the value has been set. -func (o *Route) GetDestinationOk() (*RouteDestination, bool) { - if o == nil { - return nil, false - } - return &o.Destination, true -} - -// SetDestination sets field value -func (o *Route) SetDestination(v RouteDestination) { - o.Destination = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Route) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Route) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Route) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Route) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *Route) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *Route) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *Route) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetNexthop returns the Nexthop field value -func (o *Route) GetNexthop() RouteNexthop { - if o == nil { - var ret RouteNexthop - return ret - } - - return o.Nexthop -} - -// GetNexthopOk returns a tuple with the Nexthop field value -// and a boolean to check if the value has been set. -func (o *Route) GetNexthopOk() (*RouteNexthop, bool) { - if o == nil { - return nil, false - } - return &o.Nexthop, true -} - -// SetNexthop sets field value -func (o *Route) SetNexthop(v RouteNexthop) { - o.Nexthop = v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Route) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *Route) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Route) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Route) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o Route) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Route) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - toSerialize["destination"] = o.Destination - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["nexthop"] = o.Nexthop - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Route) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "destination", - "nexthop", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRoute := _Route{} - - err = json.Unmarshal(data, &varRoute) - - if err != nil { - return err - } - - *o = Route(varRoute) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "destination") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "nexthop") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRoute struct { - value *Route - isSet bool -} - -func (v NullableRoute) Get() *Route { - return v.value -} - -func (v *NullableRoute) Set(val *Route) { - v.value = val - v.isSet = true -} - -func (v NullableRoute) IsSet() bool { - return v.isSet -} - -func (v *NullableRoute) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRoute(val *Route) *NullableRoute { - return &NullableRoute{value: val, isSet: true} -} - -func (v NullableRoute) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRoute) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_route_destination.go b/services/iaas/v2alpha1api/model_route_destination.go deleted file mode 100644 index abafa1f189..0000000000 --- a/services/iaas/v2alpha1api/model_route_destination.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// RouteDestination - struct for RouteDestination -type RouteDestination struct { - DestinationCIDRv4 *DestinationCIDRv4 - DestinationCIDRv6 *DestinationCIDRv6 -} - -// DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination -func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { - return RouteDestination{ - DestinationCIDRv4: v, - } -} - -// DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination -func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { - return RouteDestination{ - DestinationCIDRv6: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *RouteDestination) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'cidrv4' - if jsonDict["type"] == "cidrv4" { - // try to unmarshal JSON data into DestinationCIDRv4 - err = json.Unmarshal(data, &dst.DestinationCIDRv4) - if err == nil { - return nil // data stored in dst.DestinationCIDRv4, return on the first match - } else { - dst.DestinationCIDRv4 = nil - return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) - } - } - - // check if the discriminator value is 'cidrv6' - if jsonDict["type"] == "cidrv6" { - // try to unmarshal JSON data into DestinationCIDRv6 - err = json.Unmarshal(data, &dst.DestinationCIDRv6) - if err == nil { - return nil // data stored in dst.DestinationCIDRv6, return on the first match - } else { - dst.DestinationCIDRv6 = nil - return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src RouteDestination) MarshalJSON() ([]byte, error) { - if src.DestinationCIDRv4 != nil { - return json.Marshal(&src.DestinationCIDRv4) - } - - if src.DestinationCIDRv6 != nil { - return json.Marshal(&src.DestinationCIDRv6) - } - - return nil, nil // no data in oneOf schemas -} - -// 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 -} - -// Get the actual instance value -func (obj RouteDestination) GetActualInstanceValue() interface{} { - if obj.DestinationCIDRv4 != nil { - return *obj.DestinationCIDRv4 - } - - if obj.DestinationCIDRv6 != nil { - return *obj.DestinationCIDRv6 - } - - // all schemas are nil - return nil -} - -type NullableRouteDestination struct { - value *RouteDestination - isSet bool -} - -func (v NullableRouteDestination) Get() *RouteDestination { - return v.value -} - -func (v *NullableRouteDestination) Set(val *RouteDestination) { - v.value = val - v.isSet = true -} - -func (v NullableRouteDestination) IsSet() bool { - return v.isSet -} - -func (v *NullableRouteDestination) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { - return &NullableRouteDestination{value: val, isSet: true} -} - -func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_route_list_response.go b/services/iaas/v2alpha1api/model_route_list_response.go deleted file mode 100644 index ab769d51ab..0000000000 --- a/services/iaas/v2alpha1api/model_route_list_response.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the RouteListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RouteListResponse{} - -// RouteListResponse Route list response. -type RouteListResponse struct { - // A list of routes. - Items []Route `json:"items"` - AdditionalProperties map[string]interface{} -} - -type _RouteListResponse RouteListResponse - -// NewRouteListResponse instantiates a new RouteListResponse 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 NewRouteListResponse(items []Route) *RouteListResponse { - this := RouteListResponse{} - this.Items = items - return &this -} - -// NewRouteListResponseWithDefaults instantiates a new RouteListResponse 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 NewRouteListResponseWithDefaults() *RouteListResponse { - this := RouteListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *RouteListResponse) GetItems() []Route { - if o == nil { - var ret []Route - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *RouteListResponse) GetItemsOk() ([]Route, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *RouteListResponse) SetItems(v []Route) { - o.Items = v -} - -func (o RouteListResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RouteListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RouteListResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRouteListResponse := _RouteListResponse{} - - err = json.Unmarshal(data, &varRouteListResponse) - - if err != nil { - return err - } - - *o = RouteListResponse(varRouteListResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRouteListResponse struct { - value *RouteListResponse - isSet bool -} - -func (v NullableRouteListResponse) Get() *RouteListResponse { - return v.value -} - -func (v *NullableRouteListResponse) Set(val *RouteListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRouteListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRouteListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { - return &NullableRouteListResponse{value: val, isSet: true} -} - -func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_route_nexthop.go b/services/iaas/v2alpha1api/model_route_nexthop.go deleted file mode 100644 index 5dd8f67988..0000000000 --- a/services/iaas/v2alpha1api/model_route_nexthop.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// RouteNexthop - struct for RouteNexthop -type RouteNexthop struct { - NexthopBlackhole *NexthopBlackhole - NexthopIPv4 *NexthopIPv4 - NexthopIPv6 *NexthopIPv6 - NexthopInternet *NexthopInternet -} - -// NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop -func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { - return RouteNexthop{ - NexthopBlackhole: v, - } -} - -// NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop -func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { - return RouteNexthop{ - NexthopIPv4: v, - } -} - -// NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop -func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { - return RouteNexthop{ - NexthopIPv6: v, - } -} - -// NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop -func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { - return RouteNexthop{ - NexthopInternet: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'blackhole' - if jsonDict["type"] == "blackhole" { - // try to unmarshal JSON data into NexthopBlackhole - err = json.Unmarshal(data, &dst.NexthopBlackhole) - if err == nil { - return nil // data stored in dst.NexthopBlackhole, return on the first match - } else { - dst.NexthopBlackhole = nil - return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) - } - } - - // check if the discriminator value is 'internet' - if jsonDict["type"] == "internet" { - // try to unmarshal JSON data into NexthopInternet - err = json.Unmarshal(data, &dst.NexthopInternet) - if err == nil { - return nil // data stored in dst.NexthopInternet, return on the first match - } else { - dst.NexthopInternet = nil - return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) - } - } - - // check if the discriminator value is 'ipv4' - if jsonDict["type"] == "ipv4" { - // try to unmarshal JSON data into NexthopIPv4 - err = json.Unmarshal(data, &dst.NexthopIPv4) - if err == nil { - return nil // data stored in dst.NexthopIPv4, return on the first match - } else { - dst.NexthopIPv4 = nil - return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) - } - } - - // check if the discriminator value is 'ipv6' - if jsonDict["type"] == "ipv6" { - // try to unmarshal JSON data into NexthopIPv6 - err = json.Unmarshal(data, &dst.NexthopIPv6) - if err == nil { - return nil // data stored in dst.NexthopIPv6, return on the first match - } else { - dst.NexthopIPv6 = nil - return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src RouteNexthop) MarshalJSON() ([]byte, error) { - if src.NexthopBlackhole != nil { - return json.Marshal(&src.NexthopBlackhole) - } - - if src.NexthopIPv4 != nil { - return json.Marshal(&src.NexthopIPv4) - } - - if src.NexthopIPv6 != nil { - return json.Marshal(&src.NexthopIPv6) - } - - if src.NexthopInternet != nil { - return json.Marshal(&src.NexthopInternet) - } - - return nil, nil // no data in oneOf schemas -} - -// 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 -} - -// Get the actual instance value -func (obj RouteNexthop) GetActualInstanceValue() interface{} { - if obj.NexthopBlackhole != nil { - return *obj.NexthopBlackhole - } - - if obj.NexthopIPv4 != nil { - return *obj.NexthopIPv4 - } - - if obj.NexthopIPv6 != nil { - return *obj.NexthopIPv6 - } - - if obj.NexthopInternet != nil { - return *obj.NexthopInternet - } - - // all schemas are nil - return nil -} - -type NullableRouteNexthop struct { - value *RouteNexthop - isSet bool -} - -func (v NullableRouteNexthop) Get() *RouteNexthop { - return v.value -} - -func (v *NullableRouteNexthop) Set(val *RouteNexthop) { - v.value = val - v.isSet = true -} - -func (v NullableRouteNexthop) IsSet() bool { - return v.isSet -} - -func (v *NullableRouteNexthop) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { - return &NullableRouteNexthop{value: val, isSet: true} -} - -func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_routing_table.go b/services/iaas/v2alpha1api/model_routing_table.go deleted file mode 100644 index 1afc6af343..0000000000 --- a/services/iaas/v2alpha1api/model_routing_table.go +++ /dev/null @@ -1,481 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the RoutingTable type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RoutingTable{} - -// RoutingTable An object representing a routing table. Filterable Fields: `dynamicRoutes`, `systemRoutes`. -type RoutingTable struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. - Default *bool `json:"default,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // A config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -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 string) *RoutingTable { - this := RoutingTable{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - this.Name = name - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// NewRoutingTableWithDefaults instantiates a new RoutingTable object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRoutingTableWithDefaults() *RoutingTable { - this := RoutingTable{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *RoutingTable) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *RoutingTable) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *RoutingTable) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDefault returns the Default field value if set, zero value otherwise. -func (o *RoutingTable) GetDefault() bool { - if o == nil || IsNil(o.Default) { - var ret bool - return ret - } - return *o.Default -} - -// 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() (*bool, bool) { - if o == nil || IsNil(o.Default) { - return nil, false - } - return o.Default, true -} - -// HasDefault returns a boolean if a field has been set. -func (o *RoutingTable) HasDefault() bool { - if o != nil && !IsNil(o.Default) { - return true - } - - return false -} - -// SetDefault gets a reference to the given bool and assigns it to the Default field. -func (o *RoutingTable) SetDefault(v bool) { - o.Default = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *RoutingTable) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *RoutingTable) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *RoutingTable) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *RoutingTable) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RoutingTable) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *RoutingTable) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *RoutingTable) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *RoutingTable) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *RoutingTable) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *RoutingTable) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *RoutingTable) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *RoutingTable) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *RoutingTable) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *RoutingTable) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *RoutingTable) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *RoutingTable) SetName(v string) { - o.Name = v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *RoutingTable) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *RoutingTable) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *RoutingTable) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *RoutingTable) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *RoutingTable) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *RoutingTable) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o RoutingTable) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RoutingTable) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Default) { - toSerialize["default"] = o.Default - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RoutingTable) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRoutingTable := _RoutingTable{} - - err = json.Unmarshal(data, &varRoutingTable) - - if err != nil { - return err - } - - *o = RoutingTable(varRoutingTable) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "default") - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRoutingTable struct { - value *RoutingTable - isSet bool -} - -func (v NullableRoutingTable) Get() *RoutingTable { - return v.value -} - -func (v *NullableRoutingTable) Set(val *RoutingTable) { - v.value = val - v.isSet = true -} - -func (v NullableRoutingTable) IsSet() bool { - return v.isSet -} - -func (v *NullableRoutingTable) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { - return &NullableRoutingTable{value: val, isSet: true} -} - -func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_routing_table_list_response.go b/services/iaas/v2alpha1api/model_routing_table_list_response.go deleted file mode 100644 index 6609dfbb2a..0000000000 --- a/services/iaas/v2alpha1api/model_routing_table_list_response.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the RoutingTableListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RoutingTableListResponse{} - -// RoutingTableListResponse Routing table response. -type RoutingTableListResponse struct { - // A list of routing tables. - Items []RoutingTable `json:"items"` - AdditionalProperties map[string]interface{} -} - -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 []RoutingTable) *RoutingTableListResponse { - this := RoutingTableListResponse{} - 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() []RoutingTable { - if o == nil { - var ret []RoutingTable - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *RoutingTableListResponse) GetItemsOk() ([]RoutingTable, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *RoutingTableListResponse) SetItems(v []RoutingTable) { - o.Items = v -} - -func (o RoutingTableListResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RoutingTableListResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRoutingTableListResponse := _RoutingTableListResponse{} - - err = json.Unmarshal(data, &varRoutingTableListResponse) - - if err != nil { - return err - } - - *o = RoutingTableListResponse(varRoutingTableListResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRoutingTableListResponse struct { - value *RoutingTableListResponse - isSet bool -} - -func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { - return v.value -} - -func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRoutingTableListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRoutingTableListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { - return &NullableRoutingTableListResponse{value: val, isSet: true} -} - -func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_network_ipv4_body.go b/services/iaas/v2alpha1api/model_update_network_ipv4_body.go deleted file mode 100644 index d0b2989776..0000000000 --- a/services/iaas/v2alpha1api/model_update_network_ipv4_body.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateNetworkIPv4Body{} - -// UpdateNetworkIPv4Body The config object for a IPv4 network update. -type UpdateNetworkIPv4Body struct { - // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateNetworkIPv4Body UpdateNetworkIPv4Body - -// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { - this := UpdateNetworkIPv4Body{} - return &this -} - -// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { - this := UpdateNetworkIPv4Body{} - return &this -} - -// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateNetworkIPv4Body) GetGateway() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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 *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *UpdateNetworkIPv4Body) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *UpdateNetworkIPv4Body) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *UpdateNetworkIPv4Body) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *UpdateNetworkIPv4Body) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *UpdateNetworkIPv4Body) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *UpdateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *UpdateNetworkIPv4Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *UpdateNetworkIPv4Body) SetNameservers(v []string) { - o.Nameservers = v -} - -func (o UpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateNetworkIPv4Body) UnmarshalJSON(data []byte) (err error) { - varUpdateNetworkIPv4Body := _UpdateNetworkIPv4Body{} - - err = json.Unmarshal(data, &varUpdateNetworkIPv4Body) - - if err != nil { - return err - } - - *o = UpdateNetworkIPv4Body(varUpdateNetworkIPv4Body) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateNetworkIPv4Body struct { - value *UpdateNetworkIPv4Body - isSet bool -} - -func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { - return v.value -} - -func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateNetworkIPv4Body) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateNetworkIPv4Body) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { - return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} -} - -func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_network_ipv6_body.go b/services/iaas/v2alpha1api/model_update_network_ipv6_body.go deleted file mode 100644 index f48ad86852..0000000000 --- a/services/iaas/v2alpha1api/model_update_network_ipv6_body.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateNetworkIPv6Body{} - -// UpdateNetworkIPv6Body The config object for a IPv6 network update. -type UpdateNetworkIPv6Body struct { - // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\s*((([0-9a-f]{1\\,4}:){7}([0-9a-f]{1\\,4}|:))|(([0-9a-f]{1\\,4}:){6}(:[0-9a-f]{1\\,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){5}(((:[0-9a-f]{1\\,4}){1\\,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1\\,4}:){4}(((:[0-9a-f]{1\\,4}){1\\,3})|((:[0-9a-f]{1\\,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){3}(((:[0-9a-f]{1\\,4}){1\\,4})|((:[0-9a-f]{1\\,4}){0\\,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){2}(((:[0-9a-f]{1\\,4}){1\\,5})|((:[0-9a-f]{1\\,4}){0\\,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1\\,4}:){1}(((:[0-9a-f]{1\\,4}){1\\,6})|((:[0-9a-f]{1\\,4}){0\\,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1\\,4}){1\\,7})|((:[0-9a-f]{1\\,4}){0\\,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"` - // A list containing DNS Servers/Nameservers for IPv6. - Nameservers []string `json:"nameservers,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateNetworkIPv6Body UpdateNetworkIPv6Body - -// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body 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 NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { - this := UpdateNetworkIPv6Body{} - return &this -} - -// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body 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 NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { - this := UpdateNetworkIPv6Body{} - return &this -} - -// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateNetworkIPv6Body) GetGateway() string { - if o == nil || IsNil(o.Gateway.Get()) { - var ret string - return ret - } - return *o.Gateway.Get() -} - -// 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 *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() -} - -// HasGateway returns a boolean if a field has been set. -func (o *UpdateNetworkIPv6Body) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { - return true - } - - return false -} - -// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. -func (o *UpdateNetworkIPv6Body) SetGateway(v string) { - o.Gateway.Set(&v) -} - -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *UpdateNetworkIPv6Body) SetGatewayNil() { - o.Gateway.Set(nil) -} - -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *UpdateNetworkIPv6Body) UnsetGateway() { - o.Gateway.Unset() -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *UpdateNetworkIPv6Body) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *UpdateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *UpdateNetworkIPv6Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *UpdateNetworkIPv6Body) SetNameservers(v []string) { - o.Nameservers = v -} - -func (o UpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateNetworkIPv6Body) UnmarshalJSON(data []byte) (err error) { - varUpdateNetworkIPv6Body := _UpdateNetworkIPv6Body{} - - err = json.Unmarshal(data, &varUpdateNetworkIPv6Body) - - if err != nil { - return err - } - - *o = UpdateNetworkIPv6Body(varUpdateNetworkIPv6Body) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "gateway") - delete(additionalProperties, "nameservers") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateNetworkIPv6Body struct { - value *UpdateNetworkIPv6Body - isSet bool -} - -func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { - return v.value -} - -func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateNetworkIPv6Body) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateNetworkIPv6Body) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { - return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} -} - -func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go b/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go deleted file mode 100644 index 4406f7f80f..0000000000 --- a/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateRouteOfRoutingTablePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} - -// UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. -type UpdateRouteOfRoutingTablePayload struct { - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload - -// 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() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -func (o UpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateRouteOfRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { - varUpdateRouteOfRoutingTablePayload := _UpdateRouteOfRoutingTablePayload{} - - err = json.Unmarshal(data, &varUpdateRouteOfRoutingTablePayload) - - if err != nil { - return err - } - - *o = UpdateRouteOfRoutingTablePayload(varUpdateRouteOfRoutingTablePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "labels") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateRouteOfRoutingTablePayload struct { - value *UpdateRouteOfRoutingTablePayload - isSet bool -} - -func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { - return v.value -} - -func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { - return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} -} - -func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go b/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go deleted file mode 100644 index 30c815262f..0000000000 --- a/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go +++ /dev/null @@ -1,307 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateRoutingTableOfAreaPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} - -// UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. -type UpdateRoutingTableOfAreaPayload struct { - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload - -// 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() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateRoutingTableOfAreaPayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateRoutingTableOfAreaPayload) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// 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() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateRoutingTableOfAreaPayload) SetName(v string) { - o.Name = &v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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 *UpdateRoutingTableOfAreaPayload) GetSystemRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *UpdateRoutingTableOfAreaPayload) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *UpdateRoutingTableOfAreaPayload) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -func (o UpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateRoutingTableOfAreaPayload) UnmarshalJSON(data []byte) (err error) { - varUpdateRoutingTableOfAreaPayload := _UpdateRoutingTableOfAreaPayload{} - - err = json.Unmarshal(data, &varUpdateRoutingTableOfAreaPayload) - - if err != nil { - return err - } - - *o = UpdateRoutingTableOfAreaPayload(varUpdateRoutingTableOfAreaPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateRoutingTableOfAreaPayload struct { - value *UpdateRoutingTableOfAreaPayload - isSet bool -} - -func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { - return v.value -} - -func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { - return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} -} - -func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go b/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go deleted file mode 100644 index 2f7bb4264f..0000000000 --- a/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// UpdateVPCNetworkRangePayload - Object that represents the request body for a VPC network range update. -type UpdateVPCNetworkRangePayload struct { - V1UpdateVPCNetworkRangeIPv4 *V1UpdateVPCNetworkRangeIPv4 -} - -// V1UpdateVPCNetworkRangeIPv4AsUpdateVPCNetworkRangePayload is a convenience function that returns V1UpdateVPCNetworkRangeIPv4 wrapped in UpdateVPCNetworkRangePayload -func V1UpdateVPCNetworkRangeIPv4AsUpdateVPCNetworkRangePayload(v *V1UpdateVPCNetworkRangeIPv4) UpdateVPCNetworkRangePayload { - return UpdateVPCNetworkRangePayload{ - V1UpdateVPCNetworkRangeIPv4: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *UpdateVPCNetworkRangePayload) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'ipv4' - if jsonDict["ipVersion"] == "ipv4" { - // try to unmarshal JSON data into V1UpdateVPCNetworkRangeIPv4 - err = json.Unmarshal(data, &dst.V1UpdateVPCNetworkRangeIPv4) - if err == nil { - return nil // data stored in dst.V1UpdateVPCNetworkRangeIPv4, return on the first match - } else { - dst.V1UpdateVPCNetworkRangeIPv4 = nil - return fmt.Errorf("failed to unmarshal UpdateVPCNetworkRangePayload as V1UpdateVPCNetworkRangeIPv4: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src UpdateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - if src.V1UpdateVPCNetworkRangeIPv4 != nil { - return json.Marshal(&src.V1UpdateVPCNetworkRangeIPv4) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *UpdateVPCNetworkRangePayload) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.V1UpdateVPCNetworkRangeIPv4 != nil { - return obj.V1UpdateVPCNetworkRangeIPv4 - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj UpdateVPCNetworkRangePayload) GetActualInstanceValue() interface{} { - if obj.V1UpdateVPCNetworkRangeIPv4 != nil { - return *obj.V1UpdateVPCNetworkRangeIPv4 - } - - // all schemas are nil - return nil -} - -type NullableUpdateVPCNetworkRangePayload struct { - value *UpdateVPCNetworkRangePayload - isSet bool -} - -func (v NullableUpdateVPCNetworkRangePayload) Get() *UpdateVPCNetworkRangePayload { - return v.value -} - -func (v *NullableUpdateVPCNetworkRangePayload) Set(val *UpdateVPCNetworkRangePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVPCNetworkRangePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVPCNetworkRangePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVPCNetworkRangePayload(val *UpdateVPCNetworkRangePayload) *NullableUpdateVPCNetworkRangePayload { - return &NullableUpdateVPCNetworkRangePayload{value: val, isSet: true} -} - -func (v NullableUpdateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVPCNetworkRangePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_vpc_region_payload.go b/services/iaas/v2alpha1api/model_update_vpc_region_payload.go deleted file mode 100644 index 9ea2574241..0000000000 --- a/services/iaas/v2alpha1api/model_update_vpc_region_payload.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateVPCRegionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVPCRegionPayload{} - -// UpdateVPCRegionPayload The basic properties of a regional VPC. -type UpdateVPCRegionPayload struct { - Ipv4 *RegionalVPCIPv4 `json:"ipv4,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateVPCRegionPayload UpdateVPCRegionPayload - -// NewUpdateVPCRegionPayload instantiates a new UpdateVPCRegionPayload 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 NewUpdateVPCRegionPayload() *UpdateVPCRegionPayload { - this := UpdateVPCRegionPayload{} - return &this -} - -// NewUpdateVPCRegionPayloadWithDefaults instantiates a new UpdateVPCRegionPayload 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 NewUpdateVPCRegionPayloadWithDefaults() *UpdateVPCRegionPayload { - this := UpdateVPCRegionPayload{} - return &this -} - -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *UpdateVPCRegionPayload) GetIpv4() RegionalVPCIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret RegionalVPCIPv4 - return ret - } - return *o.Ipv4 -} - -// 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 *UpdateVPCRegionPayload) GetIpv4Ok() (*RegionalVPCIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *UpdateVPCRegionPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false -} - -// SetIpv4 gets a reference to the given RegionalVPCIPv4 and assigns it to the Ipv4 field. -func (o *UpdateVPCRegionPayload) SetIpv4(v RegionalVPCIPv4) { - o.Ipv4 = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateVPCRegionPayload) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *UpdateVPCRegionPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *UpdateVPCRegionPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateVPCRegionPayload) SetStatus(v string) { - o.Status = &v -} - -func (o UpdateVPCRegionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateVPCRegionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateVPCRegionPayload) UnmarshalJSON(data []byte) (err error) { - varUpdateVPCRegionPayload := _UpdateVPCRegionPayload{} - - err = json.Unmarshal(data, &varUpdateVPCRegionPayload) - - if err != nil { - return err - } - - *o = UpdateVPCRegionPayload(varUpdateVPCRegionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "ipv4") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateVPCRegionPayload struct { - value *UpdateVPCRegionPayload - isSet bool -} - -func (v NullableUpdateVPCRegionPayload) Get() *UpdateVPCRegionPayload { - return v.value -} - -func (v *NullableUpdateVPCRegionPayload) Set(val *UpdateVPCRegionPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVPCRegionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVPCRegionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVPCRegionPayload(val *UpdateVPCRegionPayload) *NullableUpdateVPCRegionPayload { - return &NullableUpdateVPCRegionPayload{value: val, isSet: true} -} - -func (v NullableUpdateVPCRegionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVPCRegionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_vpc_routing_table_payload.go b/services/iaas/v2alpha1api/model_update_vpc_routing_table_payload.go deleted file mode 100644 index 40cdbce22a..0000000000 --- a/services/iaas/v2alpha1api/model_update_vpc_routing_table_payload.go +++ /dev/null @@ -1,307 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateVPCRoutingTablePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVPCRoutingTablePayload{} - -// UpdateVPCRoutingTablePayload Object that represents the request body for a routing table update. -type UpdateVPCRoutingTablePayload struct { - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateVPCRoutingTablePayload UpdateVPCRoutingTablePayload - -// NewUpdateVPCRoutingTablePayload instantiates a new UpdateVPCRoutingTablePayload 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 NewUpdateVPCRoutingTablePayload() *UpdateVPCRoutingTablePayload { - this := UpdateVPCRoutingTablePayload{} - return &this -} - -// NewUpdateVPCRoutingTablePayloadWithDefaults instantiates a new UpdateVPCRoutingTablePayload 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 NewUpdateVPCRoutingTablePayloadWithDefaults() *UpdateVPCRoutingTablePayload { - this := UpdateVPCRoutingTablePayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateVPCRoutingTablePayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *UpdateVPCRoutingTablePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateVPCRoutingTablePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdateVPCRoutingTablePayload) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *UpdateVPCRoutingTablePayload) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCRoutingTablePayload) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *UpdateVPCRoutingTablePayload) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *UpdateVPCRoutingTablePayload) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVPCRoutingTablePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *UpdateVPCRoutingTablePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateVPCRoutingTablePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *UpdateVPCRoutingTablePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateVPCRoutingTablePayload) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// 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 *UpdateVPCRoutingTablePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateVPCRoutingTablePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateVPCRoutingTablePayload) SetName(v string) { - o.Name = &v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *UpdateVPCRoutingTablePayload) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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 *UpdateVPCRoutingTablePayload) GetSystemRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *UpdateVPCRoutingTablePayload) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *UpdateVPCRoutingTablePayload) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -func (o UpdateVPCRoutingTablePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateVPCRoutingTablePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateVPCRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { - varUpdateVPCRoutingTablePayload := _UpdateVPCRoutingTablePayload{} - - err = json.Unmarshal(data, &varUpdateVPCRoutingTablePayload) - - if err != nil { - return err - } - - *o = UpdateVPCRoutingTablePayload(varUpdateVPCRoutingTablePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateVPCRoutingTablePayload struct { - value *UpdateVPCRoutingTablePayload - isSet bool -} - -func (v NullableUpdateVPCRoutingTablePayload) Get() *UpdateVPCRoutingTablePayload { - return v.value -} - -func (v *NullableUpdateVPCRoutingTablePayload) Set(val *UpdateVPCRoutingTablePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVPCRoutingTablePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVPCRoutingTablePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVPCRoutingTablePayload(val *UpdateVPCRoutingTablePayload) *NullableUpdateVPCRoutingTablePayload { - return &NullableUpdateVPCRoutingTablePayload{value: val, isSet: true} -} - -func (v NullableUpdateVPCRoutingTablePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVPCRoutingTablePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_update_vpc_static_route_payload.go b/services/iaas/v2alpha1api/model_update_vpc_static_route_payload.go deleted file mode 100644 index 14751c70df..0000000000 --- a/services/iaas/v2alpha1api/model_update_vpc_static_route_payload.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" -) - -// checks if the UpdateVPCStaticRoutePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVPCStaticRoutePayload{} - -// UpdateVPCStaticRoutePayload Object that represents the request body for a route update. -type UpdateVPCStaticRoutePayload struct { - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateVPCStaticRoutePayload UpdateVPCStaticRoutePayload - -// NewUpdateVPCStaticRoutePayload instantiates a new UpdateVPCStaticRoutePayload 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 NewUpdateVPCStaticRoutePayload() *UpdateVPCStaticRoutePayload { - this := UpdateVPCStaticRoutePayload{} - return &this -} - -// NewUpdateVPCStaticRoutePayloadWithDefaults instantiates a new UpdateVPCStaticRoutePayload 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 NewUpdateVPCStaticRoutePayloadWithDefaults() *UpdateVPCStaticRoutePayload { - this := UpdateVPCStaticRoutePayload{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVPCStaticRoutePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *UpdateVPCStaticRoutePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateVPCStaticRoutePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *UpdateVPCStaticRoutePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -func (o UpdateVPCStaticRoutePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateVPCStaticRoutePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateVPCStaticRoutePayload) UnmarshalJSON(data []byte) (err error) { - varUpdateVPCStaticRoutePayload := _UpdateVPCStaticRoutePayload{} - - err = json.Unmarshal(data, &varUpdateVPCStaticRoutePayload) - - if err != nil { - return err - } - - *o = UpdateVPCStaticRoutePayload(varUpdateVPCStaticRoutePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "labels") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateVPCStaticRoutePayload struct { - value *UpdateVPCStaticRoutePayload - isSet bool -} - -func (v NullableUpdateVPCStaticRoutePayload) Get() *UpdateVPCStaticRoutePayload { - return v.value -} - -func (v *NullableUpdateVPCStaticRoutePayload) Set(val *UpdateVPCStaticRoutePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateVPCStaticRoutePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateVPCStaticRoutePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateVPCStaticRoutePayload(val *UpdateVPCStaticRoutePayload) *NullableUpdateVPCStaticRoutePayload { - return &NullableUpdateVPCStaticRoutePayload{value: val, isSet: true} -} - -func (v NullableUpdateVPCStaticRoutePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateVPCStaticRoutePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4.go b/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4.go deleted file mode 100644 index bac963e7c2..0000000000 --- a/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the V1UpdateVPCNetworkRangeIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1UpdateVPCNetworkRangeIPv4{} - -// V1UpdateVPCNetworkRangeIPv4 Contains the IPv4 properties of a VPC network range update. -type V1UpdateVPCNetworkRangeIPv4 struct { - // The default prefix length for network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - IpVersion V1UpdateVPCNetworkRangeIPv4IpVersion `json:"ipVersion"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The maximal prefix length for network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _V1UpdateVPCNetworkRangeIPv4 V1UpdateVPCNetworkRangeIPv4 - -// NewV1UpdateVPCNetworkRangeIPv4 instantiates a new V1UpdateVPCNetworkRangeIPv4 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 NewV1UpdateVPCNetworkRangeIPv4(ipVersion V1UpdateVPCNetworkRangeIPv4IpVersion) *V1UpdateVPCNetworkRangeIPv4 { - this := V1UpdateVPCNetworkRangeIPv4{} - this.IpVersion = ipVersion - return &this -} - -// NewV1UpdateVPCNetworkRangeIPv4WithDefaults instantiates a new V1UpdateVPCNetworkRangeIPv4 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 NewV1UpdateVPCNetworkRangeIPv4WithDefaults() *V1UpdateVPCNetworkRangeIPv4 { - this := V1UpdateVPCNetworkRangeIPv4{} - return &this -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetDescription(v string) { - o.Description = &v -} - -// GetIpVersion returns the IpVersion field value -func (o *V1UpdateVPCNetworkRangeIPv4) GetIpVersion() V1UpdateVPCNetworkRangeIPv4IpVersion { - if o == nil { - var ret V1UpdateVPCNetworkRangeIPv4IpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) GetIpVersionOk() (*V1UpdateVPCNetworkRangeIPv4IpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *V1UpdateVPCNetworkRangeIPv4) SetIpVersion(v V1UpdateVPCNetworkRangeIPv4IpVersion) { - o.IpVersion = v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *V1UpdateVPCNetworkRangeIPv4) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *V1UpdateVPCNetworkRangeIPv4) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *V1UpdateVPCNetworkRangeIPv4) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *V1UpdateVPCNetworkRangeIPv4) SetNameservers(v []string) { - o.Nameservers = v -} - -func (o V1UpdateVPCNetworkRangeIPv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o V1UpdateVPCNetworkRangeIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *V1UpdateVPCNetworkRangeIPv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varV1UpdateVPCNetworkRangeIPv4 := _V1UpdateVPCNetworkRangeIPv4{} - - err = json.Unmarshal(data, &varV1UpdateVPCNetworkRangeIPv4) - - if err != nil { - return err - } - - *o = V1UpdateVPCNetworkRangeIPv4(varV1UpdateVPCNetworkRangeIPv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "description") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "labels") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableV1UpdateVPCNetworkRangeIPv4 struct { - value *V1UpdateVPCNetworkRangeIPv4 - isSet bool -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4) Get() *V1UpdateVPCNetworkRangeIPv4 { - return v.value -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4) Set(val *V1UpdateVPCNetworkRangeIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1UpdateVPCNetworkRangeIPv4(val *V1UpdateVPCNetworkRangeIPv4) *NullableV1UpdateVPCNetworkRangeIPv4 { - return &NullableV1UpdateVPCNetworkRangeIPv4{value: val, isSet: true} -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4_ip_version.go b/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4_ip_version.go deleted file mode 100644 index e9f47d37c1..0000000000 --- a/services/iaas/v2alpha1api/model_v1_update_vpc_network_range_ipv4_ip_version.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// V1UpdateVPCNetworkRangeIPv4IpVersion The IP version of the network range being updated. -type V1UpdateVPCNetworkRangeIPv4IpVersion string - -// List of v1UpdateVPCNetworkRangeIPv4_ipVersion -const ( - V1UPDATEVPCNETWORKRANGEIPV4IPVERSION_IPV4 V1UpdateVPCNetworkRangeIPv4IpVersion = "ipv4" - V1UPDATEVPCNETWORKRANGEIPV4IPVERSION_UNKNOWN_DEFAULT_OPEN_API V1UpdateVPCNetworkRangeIPv4IpVersion = "unknown_default_open_api" -) - -// All allowed values of V1UpdateVPCNetworkRangeIPv4IpVersion enum -var AllowedV1UpdateVPCNetworkRangeIPv4IpVersionEnumValues = []V1UpdateVPCNetworkRangeIPv4IpVersion{ - "ipv4", - "unknown_default_open_api", -} - -func (v *V1UpdateVPCNetworkRangeIPv4IpVersion) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := V1UpdateVPCNetworkRangeIPv4IpVersion(value) - for _, existing := range AllowedV1UpdateVPCNetworkRangeIPv4IpVersionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = V1UPDATEVPCNETWORKRANGEIPV4IPVERSION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewV1UpdateVPCNetworkRangeIPv4IpVersionFromValue returns a pointer to a valid V1UpdateVPCNetworkRangeIPv4IpVersion -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewV1UpdateVPCNetworkRangeIPv4IpVersionFromValue(v string) (*V1UpdateVPCNetworkRangeIPv4IpVersion, error) { - ev := V1UpdateVPCNetworkRangeIPv4IpVersion(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for V1UpdateVPCNetworkRangeIPv4IpVersion: valid values are %v", v, AllowedV1UpdateVPCNetworkRangeIPv4IpVersionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v V1UpdateVPCNetworkRangeIPv4IpVersion) IsValid() bool { - for _, existing := range AllowedV1UpdateVPCNetworkRangeIPv4IpVersionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to v1UpdateVPCNetworkRangeIPv4_ipVersion value -func (v V1UpdateVPCNetworkRangeIPv4IpVersion) Ptr() *V1UpdateVPCNetworkRangeIPv4IpVersion { - return &v -} - -type NullableV1UpdateVPCNetworkRangeIPv4IpVersion struct { - value *V1UpdateVPCNetworkRangeIPv4IpVersion - isSet bool -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4IpVersion) Get() *V1UpdateVPCNetworkRangeIPv4IpVersion { - return v.value -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4IpVersion) Set(val *V1UpdateVPCNetworkRangeIPv4IpVersion) { - v.value = val - v.isSet = true -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4IpVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4IpVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1UpdateVPCNetworkRangeIPv4IpVersion(val *V1UpdateVPCNetworkRangeIPv4IpVersion) *NullableV1UpdateVPCNetworkRangeIPv4IpVersion { - return &NullableV1UpdateVPCNetworkRangeIPv4IpVersion{value: val, isSet: true} -} - -func (v NullableV1UpdateVPCNetworkRangeIPv4IpVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1UpdateVPCNetworkRangeIPv4IpVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc.go b/services/iaas/v2alpha1api/model_vpc.go deleted file mode 100644 index 9163d47d8c..0000000000 --- a/services/iaas/v2alpha1api/model_vpc.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the VPC type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPC{} - -// VPC Object that represents a VPC. Filterable Fields: `name`. -type VPC struct { - // Date-time when resource was created. - CreatedAt time.Time `json:"createdAt"` - // Description Object. Allows string up to 255 Characters. - Description string `json:"description"` - // Universally Unique Identifier (UUID). - Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // Universally Unique Identifier (UUID). - ProjectId string `json:"projectId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Date-time when resource was last updated. - UpdatedAt time.Time `json:"updatedAt"` - AdditionalProperties map[string]interface{} -} - -type _VPC VPC - -// NewVPC instantiates a new VPC 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 NewVPC(createdAt time.Time, description string, id string, labels map[string]interface{}, name string, projectId string, updatedAt time.Time) *VPC { - this := VPC{} - this.CreatedAt = createdAt - this.Description = description - this.Id = id - this.Labels = labels - this.Name = name - this.ProjectId = projectId - this.UpdatedAt = updatedAt - return &this -} - -// NewVPCWithDefaults instantiates a new VPC 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 NewVPCWithDefaults() *VPC { - this := VPC{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value -func (o *VPC) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *VPC) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *VPC) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetDescription returns the Description field value -func (o *VPC) GetDescription() string { - if o == nil { - var ret string - return ret - } - - return o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *VPC) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *VPC) SetDescription(v string) { - o.Description = v -} - -// GetId returns the Id field value -func (o *VPC) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *VPC) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *VPC) SetId(v string) { - o.Id = v -} - -// GetLabels returns the Labels field value -func (o *VPC) GetLabels() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - - return o.Labels -} - -// GetLabelsOk returns a tuple with the Labels field value -// and a boolean to check if the value has been set. -func (o *VPC) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// SetLabels sets field value -func (o *VPC) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *VPC) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *VPC) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *VPC) SetName(v string) { - o.Name = v -} - -// GetProjectId returns the ProjectId field value -func (o *VPC) GetProjectId() string { - if o == nil { - var ret string - return ret - } - - return o.ProjectId -} - -// GetProjectIdOk returns a tuple with the ProjectId field value -// and a boolean to check if the value has been set. -func (o *VPC) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ProjectId, true -} - -// SetProjectId sets field value -func (o *VPC) SetProjectId(v string) { - o.ProjectId = v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *VPC) GetUpdatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value -// and a boolean to check if the value has been set. -func (o *VPC) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *VPC) SetUpdatedAt(v time.Time) { - o.UpdatedAt = v -} - -func (o VPC) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPC) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["createdAt"] = o.CreatedAt - toSerialize["description"] = o.Description - toSerialize["id"] = o.Id - toSerialize["labels"] = o.Labels - toSerialize["name"] = o.Name - toSerialize["projectId"] = o.ProjectId - toSerialize["updatedAt"] = o.UpdatedAt - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPC) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "createdAt", - "description", - "id", - "labels", - "name", - "projectId", - "updatedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPC := _VPC{} - - err = json.Unmarshal(data, &varVPC) - - if err != nil { - return err - } - - *o = VPC(varVPC) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPC struct { - value *VPC - isSet bool -} - -func (v NullableVPC) Get() *VPC { - return v.value -} - -func (v *NullableVPC) Set(val *VPC) { - v.value = val - v.isSet = true -} - -func (v NullableVPC) IsSet() bool { - return v.isSet -} - -func (v *NullableVPC) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPC(val *VPC) *NullableVPC { - return &NullableVPC{value: val, isSet: true} -} - -func (v NullableVPC) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPC) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_base_network_range.go b/services/iaas/v2alpha1api/model_vpc_base_network_range.go deleted file mode 100644 index b0a22e61ad..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_base_network_range.go +++ /dev/null @@ -1,346 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "time" -) - -// checks if the VPCBaseNetworkRange type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCBaseNetworkRange{} - -// VPCBaseNetworkRange Contains the common properties of a VPC network range. -type VPCBaseNetworkRange struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _VPCBaseNetworkRange VPCBaseNetworkRange - -// NewVPCBaseNetworkRange instantiates a new VPCBaseNetworkRange 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 NewVPCBaseNetworkRange() *VPCBaseNetworkRange { - this := VPCBaseNetworkRange{} - return &this -} - -// NewVPCBaseNetworkRangeWithDefaults instantiates a new VPCBaseNetworkRange 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 NewVPCBaseNetworkRangeWithDefaults() *VPCBaseNetworkRange { - this := VPCBaseNetworkRange{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *VPCBaseNetworkRange) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *VPCBaseNetworkRange) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *VPCBaseNetworkRange) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *VPCBaseNetworkRange) SetDescription(v string) { - o.Description = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *VPCBaseNetworkRange) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *VPCBaseNetworkRange) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *VPCBaseNetworkRange) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *VPCBaseNetworkRange) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *VPCBaseNetworkRange) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *VPCBaseNetworkRange) SetStatus(v string) { - o.Status = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *VPCBaseNetworkRange) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *VPCBaseNetworkRange) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *VPCBaseNetworkRange) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *VPCBaseNetworkRange) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o VPCBaseNetworkRange) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCBaseNetworkRange) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCBaseNetworkRange) UnmarshalJSON(data []byte) (err error) { - varVPCBaseNetworkRange := _VPCBaseNetworkRange{} - - err = json.Unmarshal(data, &varVPCBaseNetworkRange) - - if err != nil { - return err - } - - *o = VPCBaseNetworkRange(varVPCBaseNetworkRange) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCBaseNetworkRange struct { - value *VPCBaseNetworkRange - isSet bool -} - -func (v NullableVPCBaseNetworkRange) Get() *VPCBaseNetworkRange { - return v.value -} - -func (v *NullableVPCBaseNetworkRange) Set(val *VPCBaseNetworkRange) { - v.value = val - v.isSet = true -} - -func (v NullableVPCBaseNetworkRange) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCBaseNetworkRange) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCBaseNetworkRange(val *VPCBaseNetworkRange) *NullableVPCBaseNetworkRange { - return &NullableVPCBaseNetworkRange{value: val, isSet: true} -} - -func (v NullableVPCBaseNetworkRange) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCBaseNetworkRange) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_list.go b/services/iaas/v2alpha1api/model_vpc_list.go deleted file mode 100644 index 83687cb9fa..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_list.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the VPCList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCList{} - -// VPCList VPC list response. -type VPCList struct { - // A list of VPCs. - Items []VPC `json:"items"` - AdditionalProperties map[string]interface{} -} - -type _VPCList VPCList - -// NewVPCList instantiates a new VPCList 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 NewVPCList(items []VPC) *VPCList { - this := VPCList{} - this.Items = items - return &this -} - -// NewVPCListWithDefaults instantiates a new VPCList 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 NewVPCListWithDefaults() *VPCList { - this := VPCList{} - return &this -} - -// GetItems returns the Items field value -func (o *VPCList) GetItems() []VPC { - if o == nil { - var ret []VPC - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *VPCList) GetItemsOk() ([]VPC, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *VPCList) SetItems(v []VPC) { - o.Items = v -} - -func (o VPCList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCList) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCList := _VPCList{} - - err = json.Unmarshal(data, &varVPCList) - - if err != nil { - return err - } - - *o = VPCList(varVPCList) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCList struct { - value *VPCList - isSet bool -} - -func (v NullableVPCList) Get() *VPCList { - return v.value -} - -func (v *NullableVPCList) Set(val *VPCList) { - v.value = val - v.isSet = true -} - -func (v NullableVPCList) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCList(val *VPCList) *NullableVPCList { - return &NullableVPCList{value: val, isSet: true} -} - -func (v NullableVPCList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range.go b/services/iaas/v2alpha1api/model_vpc_network_range.go deleted file mode 100644 index 2410ee26c5..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// VPCNetworkRange - A VPC network range. -type VPCNetworkRange struct { - VPCNetworkRangeIPv4 *VPCNetworkRangeIPv4 - VPCNetworkRangeIPv6 *VPCNetworkRangeIPv6 -} - -// VPCNetworkRangeIPv4AsVPCNetworkRange is a convenience function that returns VPCNetworkRangeIPv4 wrapped in VPCNetworkRange -func VPCNetworkRangeIPv4AsVPCNetworkRange(v *VPCNetworkRangeIPv4) VPCNetworkRange { - return VPCNetworkRange{ - VPCNetworkRangeIPv4: v, - } -} - -// VPCNetworkRangeIPv6AsVPCNetworkRange is a convenience function that returns VPCNetworkRangeIPv6 wrapped in VPCNetworkRange -func VPCNetworkRangeIPv6AsVPCNetworkRange(v *VPCNetworkRangeIPv6) VPCNetworkRange { - return VPCNetworkRange{ - VPCNetworkRangeIPv6: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *VPCNetworkRange) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'ipv4' - if jsonDict["ipVersion"] == "ipv4" { - // try to unmarshal JSON data into VPCNetworkRangeIPv4 - err = json.Unmarshal(data, &dst.VPCNetworkRangeIPv4) - if err == nil { - return nil // data stored in dst.VPCNetworkRangeIPv4, return on the first match - } else { - dst.VPCNetworkRangeIPv4 = nil - return fmt.Errorf("failed to unmarshal VPCNetworkRange as VPCNetworkRangeIPv4: %s", err.Error()) - } - } - - // check if the discriminator value is 'ipv6' - if jsonDict["ipVersion"] == "ipv6" { - // try to unmarshal JSON data into VPCNetworkRangeIPv6 - err = json.Unmarshal(data, &dst.VPCNetworkRangeIPv6) - if err == nil { - return nil // data stored in dst.VPCNetworkRangeIPv6, return on the first match - } else { - dst.VPCNetworkRangeIPv6 = nil - return fmt.Errorf("failed to unmarshal VPCNetworkRange as VPCNetworkRangeIPv6: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src VPCNetworkRange) MarshalJSON() ([]byte, error) { - if src.VPCNetworkRangeIPv4 != nil { - return json.Marshal(&src.VPCNetworkRangeIPv4) - } - - if src.VPCNetworkRangeIPv6 != nil { - return json.Marshal(&src.VPCNetworkRangeIPv6) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *VPCNetworkRange) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.VPCNetworkRangeIPv4 != nil { - return obj.VPCNetworkRangeIPv4 - } - - if obj.VPCNetworkRangeIPv6 != nil { - return obj.VPCNetworkRangeIPv6 - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj VPCNetworkRange) GetActualInstanceValue() interface{} { - if obj.VPCNetworkRangeIPv4 != nil { - return *obj.VPCNetworkRangeIPv4 - } - - if obj.VPCNetworkRangeIPv6 != nil { - return *obj.VPCNetworkRangeIPv6 - } - - // all schemas are nil - return nil -} - -type NullableVPCNetworkRange struct { - value *VPCNetworkRange - isSet bool -} - -func (v NullableVPCNetworkRange) Get() *VPCNetworkRange { - return v.value -} - -func (v *NullableVPCNetworkRange) Set(val *VPCNetworkRange) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRange) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRange) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRange(val *VPCNetworkRange) *NullableVPCNetworkRange { - return &NullableVPCNetworkRange{value: val, isSet: true} -} - -func (v NullableVPCNetworkRange) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRange) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range_ipv4.go b/services/iaas/v2alpha1api/model_vpc_network_range_ipv4.go deleted file mode 100644 index f82d3ea721..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range_ipv4.go +++ /dev/null @@ -1,590 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the VPCNetworkRangeIPv4 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCNetworkRangeIPv4{} - -// VPCNetworkRangeIPv4 Contains the IPv4 properties of a VPC network range. -type VPCNetworkRangeIPv4 struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - // The default prefix length for network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - IpVersion VPCNetworkRangeIPv4AllOfIpVersion `json:"ipVersion"` - // The maximal prefix length for network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR). - Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1\\,4}:){7\\,7}[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,7}:|([0-9a-fA-F]{1\\,4}:){1\\,6}:[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,5}(:[0-9a-fA-F]{1\\,4}){1\\,2}|([0-9a-fA-F]{1\\,4}:){1\\,4}(:[0-9a-fA-F]{1\\,4}){1\\,3}|([0-9a-fA-F]{1\\,4}:){1\\,3}(:[0-9a-fA-F]{1\\,4}){1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,2}(:[0-9a-fA-F]{1\\,4}){1\\,5}|[0-9a-fA-F]{1\\,4}:((:[0-9a-fA-F]{1\\,4}){1\\,6})|:((:[0-9a-fA-F]{1\\,4}){1\\,7}|:)|fe80:(:[0-9a-fA-F]{0\\,4}){0\\,4}%[0-9a-zA-Z]{1\\,}|::(ffff(:0{1\\,4}){0\\,1}:){0\\,1}((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])|([0-9a-fA-F]{1\\,4}:){1\\,4}:((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9]))(/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - AdditionalProperties map[string]interface{} -} - -type _VPCNetworkRangeIPv4 VPCNetworkRangeIPv4 - -// NewVPCNetworkRangeIPv4 instantiates a new VPCNetworkRangeIPv4 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 NewVPCNetworkRangeIPv4(ipVersion VPCNetworkRangeIPv4AllOfIpVersion, prefix string) *VPCNetworkRangeIPv4 { - this := VPCNetworkRangeIPv4{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - this.IpVersion = ipVersion - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - this.Prefix = prefix - return &this -} - -// NewVPCNetworkRangeIPv4WithDefaults instantiates a new VPCNetworkRangeIPv4 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 NewVPCNetworkRangeIPv4WithDefaults() *VPCNetworkRangeIPv4 { - this := VPCNetworkRangeIPv4{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *VPCNetworkRangeIPv4) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *VPCNetworkRangeIPv4) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *VPCNetworkRangeIPv4) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *VPCNetworkRangeIPv4) SetDescription(v string) { - o.Description = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *VPCNetworkRangeIPv4) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *VPCNetworkRangeIPv4) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *VPCNetworkRangeIPv4) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *VPCNetworkRangeIPv4) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *VPCNetworkRangeIPv4) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *VPCNetworkRangeIPv4) SetStatus(v string) { - o.Status = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *VPCNetworkRangeIPv4) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *VPCNetworkRangeIPv4) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen -} - -// 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 *VPCNetworkRangeIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *VPCNetworkRangeIPv4) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetIpVersion returns the IpVersion field value -func (o *VPCNetworkRangeIPv4) GetIpVersion() VPCNetworkRangeIPv4AllOfIpVersion { - if o == nil { - var ret VPCNetworkRangeIPv4AllOfIpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *VPCNetworkRangeIPv4) GetIpVersionOk() (*VPCNetworkRangeIPv4AllOfIpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *VPCNetworkRangeIPv4) SetIpVersion(v VPCNetworkRangeIPv4AllOfIpVersion) { - o.IpVersion = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// 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 *VPCNetworkRangeIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *VPCNetworkRangeIPv4) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// 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 *VPCNetworkRangeIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *VPCNetworkRangeIPv4) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv4) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *VPCNetworkRangeIPv4) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv4) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *VPCNetworkRangeIPv4) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *VPCNetworkRangeIPv4) GetPrefix() string { - if o == nil { - var ret string - return ret - } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *VPCNetworkRangeIPv4) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Prefix, true -} - -// SetPrefix sets field value -func (o *VPCNetworkRangeIPv4) SetPrefix(v string) { - o.Prefix = v -} - -func (o VPCNetworkRangeIPv4) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCNetworkRangeIPv4) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCNetworkRangeIPv4) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCNetworkRangeIPv4 := _VPCNetworkRangeIPv4{} - - err = json.Unmarshal(data, &varVPCNetworkRangeIPv4) - - if err != nil { - return err - } - - *o = VPCNetworkRangeIPv4(varVPCNetworkRangeIPv4) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCNetworkRangeIPv4 struct { - value *VPCNetworkRangeIPv4 - isSet bool -} - -func (v NullableVPCNetworkRangeIPv4) Get() *VPCNetworkRangeIPv4 { - return v.value -} - -func (v *NullableVPCNetworkRangeIPv4) Set(val *VPCNetworkRangeIPv4) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRangeIPv4) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRangeIPv4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRangeIPv4(val *VPCNetworkRangeIPv4) *NullableVPCNetworkRangeIPv4 { - return &NullableVPCNetworkRangeIPv4{value: val, isSet: true} -} - -func (v NullableVPCNetworkRangeIPv4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRangeIPv4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range_ipv4_all_of_ip_version.go b/services/iaas/v2alpha1api/model_vpc_network_range_ipv4_all_of_ip_version.go deleted file mode 100644 index b7c37850b6..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range_ipv4_all_of_ip_version.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// VPCNetworkRangeIPv4AllOfIpVersion the model 'VPCNetworkRangeIPv4AllOfIpVersion' -type VPCNetworkRangeIPv4AllOfIpVersion string - -// List of VPCNetworkRangeIPv4_allOf_ipVersion -const ( - VPCNETWORKRANGEIPV4ALLOFIPVERSION_IPV4 VPCNetworkRangeIPv4AllOfIpVersion = "ipv4" - VPCNETWORKRANGEIPV4ALLOFIPVERSION_UNKNOWN_DEFAULT_OPEN_API VPCNetworkRangeIPv4AllOfIpVersion = "unknown_default_open_api" -) - -// All allowed values of VPCNetworkRangeIPv4AllOfIpVersion enum -var AllowedVPCNetworkRangeIPv4AllOfIpVersionEnumValues = []VPCNetworkRangeIPv4AllOfIpVersion{ - "ipv4", - "unknown_default_open_api", -} - -func (v *VPCNetworkRangeIPv4AllOfIpVersion) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := VPCNetworkRangeIPv4AllOfIpVersion(value) - for _, existing := range AllowedVPCNetworkRangeIPv4AllOfIpVersionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = VPCNETWORKRANGEIPV4ALLOFIPVERSION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewVPCNetworkRangeIPv4AllOfIpVersionFromValue returns a pointer to a valid VPCNetworkRangeIPv4AllOfIpVersion -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewVPCNetworkRangeIPv4AllOfIpVersionFromValue(v string) (*VPCNetworkRangeIPv4AllOfIpVersion, error) { - ev := VPCNetworkRangeIPv4AllOfIpVersion(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for VPCNetworkRangeIPv4AllOfIpVersion: valid values are %v", v, AllowedVPCNetworkRangeIPv4AllOfIpVersionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v VPCNetworkRangeIPv4AllOfIpVersion) IsValid() bool { - for _, existing := range AllowedVPCNetworkRangeIPv4AllOfIpVersionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to VPCNetworkRangeIPv4_allOf_ipVersion value -func (v VPCNetworkRangeIPv4AllOfIpVersion) Ptr() *VPCNetworkRangeIPv4AllOfIpVersion { - return &v -} - -type NullableVPCNetworkRangeIPv4AllOfIpVersion struct { - value *VPCNetworkRangeIPv4AllOfIpVersion - isSet bool -} - -func (v NullableVPCNetworkRangeIPv4AllOfIpVersion) Get() *VPCNetworkRangeIPv4AllOfIpVersion { - return v.value -} - -func (v *NullableVPCNetworkRangeIPv4AllOfIpVersion) Set(val *VPCNetworkRangeIPv4AllOfIpVersion) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRangeIPv4AllOfIpVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRangeIPv4AllOfIpVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRangeIPv4AllOfIpVersion(val *VPCNetworkRangeIPv4AllOfIpVersion) *NullableVPCNetworkRangeIPv4AllOfIpVersion { - return &NullableVPCNetworkRangeIPv4AllOfIpVersion{value: val, isSet: true} -} - -func (v NullableVPCNetworkRangeIPv4AllOfIpVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRangeIPv4AllOfIpVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range_ipv6.go b/services/iaas/v2alpha1api/model_vpc_network_range_ipv6.go deleted file mode 100644 index 70a95c9f56..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range_ipv6.go +++ /dev/null @@ -1,578 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the VPCNetworkRangeIPv6 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCNetworkRangeIPv6{} - -// VPCNetworkRangeIPv6 Contains the IPv6 properties of a VPC network range. -type VPCNetworkRangeIPv6 struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - Status *string `json:"status,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - // The ipv6 prefix lengths for subnets or network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - IpVersion VPCNetworkRangeIPv6AllOfIpVersion `json:"ipVersion"` - // The ipv6 prefix lengths for subnets or network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The ipv6 prefix lengths for subnets or network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv6. - Nameservers []string `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR) for IPv6. - Prefix string `json:"prefix" validate:"regexp=^(([0-9a-fA-F]{1\\,4}:){7\\,7}[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,7}:|([0-9a-fA-F]{1\\,4}:){1\\,6}:[0-9a-fA-F]{1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,5}(:[0-9a-fA-F]{1\\,4}){1\\,2}|([0-9a-fA-F]{1\\,4}:){1\\,4}(:[0-9a-fA-F]{1\\,4}){1\\,3}|([0-9a-fA-F]{1\\,4}:){1\\,3}(:[0-9a-fA-F]{1\\,4}){1\\,4}|([0-9a-fA-F]{1\\,4}:){1\\,2}(:[0-9a-fA-F]{1\\,4}){1\\,5}|[0-9a-fA-F]{1\\,4}:((:[0-9a-fA-F]{1\\,4}){1\\,6})|:((:[0-9a-fA-F]{1\\,4}){1\\,7}|:)|fe80:(:[0-9a-fA-F]{0\\,4}){0\\,4}%[0-9a-zA-Z]{1\\,}|::(ffff(:0{1\\,4}){0\\,1}:){0\\,1}((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])|([0-9a-fA-F]{1\\,4}:){1\\,4}:((25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9])\\.){3\\,3}(25[0-5]|(2[0-4]|1{0\\,1}[0-9]){0\\,1}[0-9]))(/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - AdditionalProperties map[string]interface{} -} - -type _VPCNetworkRangeIPv6 VPCNetworkRangeIPv6 - -// NewVPCNetworkRangeIPv6 instantiates a new VPCNetworkRangeIPv6 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 NewVPCNetworkRangeIPv6(ipVersion VPCNetworkRangeIPv6AllOfIpVersion, prefix string) *VPCNetworkRangeIPv6 { - this := VPCNetworkRangeIPv6{} - this.IpVersion = ipVersion - this.Prefix = prefix - return &this -} - -// NewVPCNetworkRangeIPv6WithDefaults instantiates a new VPCNetworkRangeIPv6 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 NewVPCNetworkRangeIPv6WithDefaults() *VPCNetworkRangeIPv6 { - this := VPCNetworkRangeIPv6{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *VPCNetworkRangeIPv6) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *VPCNetworkRangeIPv6) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *VPCNetworkRangeIPv6) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *VPCNetworkRangeIPv6) SetDescription(v string) { - o.Description = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *VPCNetworkRangeIPv6) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *VPCNetworkRangeIPv6) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *VPCNetworkRangeIPv6) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *VPCNetworkRangeIPv6) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// 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 *VPCNetworkRangeIPv6) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *VPCNetworkRangeIPv6) SetStatus(v string) { - o.Status = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *VPCNetworkRangeIPv6) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *VPCNetworkRangeIPv6) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen -} - -// 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 *VPCNetworkRangeIPv6) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *VPCNetworkRangeIPv6) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetIpVersion returns the IpVersion field value -func (o *VPCNetworkRangeIPv6) GetIpVersion() VPCNetworkRangeIPv6AllOfIpVersion { - if o == nil { - var ret VPCNetworkRangeIPv6AllOfIpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *VPCNetworkRangeIPv6) GetIpVersionOk() (*VPCNetworkRangeIPv6AllOfIpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *VPCNetworkRangeIPv6) SetIpVersion(v VPCNetworkRangeIPv6AllOfIpVersion) { - o.IpVersion = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// 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 *VPCNetworkRangeIPv6) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *VPCNetworkRangeIPv6) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// 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 *VPCNetworkRangeIPv6) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *VPCNetworkRangeIPv6) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *VPCNetworkRangeIPv6) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret - } - return o.Nameservers -} - -// 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 *VPCNetworkRangeIPv6) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true -} - -// HasNameservers returns a boolean if a field has been set. -func (o *VPCNetworkRangeIPv6) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *VPCNetworkRangeIPv6) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *VPCNetworkRangeIPv6) GetPrefix() string { - if o == nil { - var ret string - return ret - } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *VPCNetworkRangeIPv6) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Prefix, true -} - -// SetPrefix sets field value -func (o *VPCNetworkRangeIPv6) SetPrefix(v string) { - o.Prefix = v -} - -func (o VPCNetworkRangeIPv6) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCNetworkRangeIPv6) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCNetworkRangeIPv6) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCNetworkRangeIPv6 := _VPCNetworkRangeIPv6{} - - err = json.Unmarshal(data, &varVPCNetworkRangeIPv6) - - if err != nil { - return err - } - - *o = VPCNetworkRangeIPv6(varVPCNetworkRangeIPv6) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCNetworkRangeIPv6 struct { - value *VPCNetworkRangeIPv6 - isSet bool -} - -func (v NullableVPCNetworkRangeIPv6) Get() *VPCNetworkRangeIPv6 { - return v.value -} - -func (v *NullableVPCNetworkRangeIPv6) Set(val *VPCNetworkRangeIPv6) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRangeIPv6) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRangeIPv6) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRangeIPv6(val *VPCNetworkRangeIPv6) *NullableVPCNetworkRangeIPv6 { - return &NullableVPCNetworkRangeIPv6{value: val, isSet: true} -} - -func (v NullableVPCNetworkRangeIPv6) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRangeIPv6) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range_ipv6_all_of_ip_version.go b/services/iaas/v2alpha1api/model_vpc_network_range_ipv6_all_of_ip_version.go deleted file mode 100644 index 1caa93351a..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range_ipv6_all_of_ip_version.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// VPCNetworkRangeIPv6AllOfIpVersion the model 'VPCNetworkRangeIPv6AllOfIpVersion' -type VPCNetworkRangeIPv6AllOfIpVersion string - -// List of VPCNetworkRangeIPv6_allOf_ipVersion -const ( - VPCNETWORKRANGEIPV6ALLOFIPVERSION_IPV6 VPCNetworkRangeIPv6AllOfIpVersion = "ipv6" - VPCNETWORKRANGEIPV6ALLOFIPVERSION_UNKNOWN_DEFAULT_OPEN_API VPCNetworkRangeIPv6AllOfIpVersion = "unknown_default_open_api" -) - -// All allowed values of VPCNetworkRangeIPv6AllOfIpVersion enum -var AllowedVPCNetworkRangeIPv6AllOfIpVersionEnumValues = []VPCNetworkRangeIPv6AllOfIpVersion{ - "ipv6", - "unknown_default_open_api", -} - -func (v *VPCNetworkRangeIPv6AllOfIpVersion) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := VPCNetworkRangeIPv6AllOfIpVersion(value) - for _, existing := range AllowedVPCNetworkRangeIPv6AllOfIpVersionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = VPCNETWORKRANGEIPV6ALLOFIPVERSION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewVPCNetworkRangeIPv6AllOfIpVersionFromValue returns a pointer to a valid VPCNetworkRangeIPv6AllOfIpVersion -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewVPCNetworkRangeIPv6AllOfIpVersionFromValue(v string) (*VPCNetworkRangeIPv6AllOfIpVersion, error) { - ev := VPCNetworkRangeIPv6AllOfIpVersion(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for VPCNetworkRangeIPv6AllOfIpVersion: valid values are %v", v, AllowedVPCNetworkRangeIPv6AllOfIpVersionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v VPCNetworkRangeIPv6AllOfIpVersion) IsValid() bool { - for _, existing := range AllowedVPCNetworkRangeIPv6AllOfIpVersionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to VPCNetworkRangeIPv6_allOf_ipVersion value -func (v VPCNetworkRangeIPv6AllOfIpVersion) Ptr() *VPCNetworkRangeIPv6AllOfIpVersion { - return &v -} - -type NullableVPCNetworkRangeIPv6AllOfIpVersion struct { - value *VPCNetworkRangeIPv6AllOfIpVersion - isSet bool -} - -func (v NullableVPCNetworkRangeIPv6AllOfIpVersion) Get() *VPCNetworkRangeIPv6AllOfIpVersion { - return v.value -} - -func (v *NullableVPCNetworkRangeIPv6AllOfIpVersion) Set(val *VPCNetworkRangeIPv6AllOfIpVersion) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRangeIPv6AllOfIpVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRangeIPv6AllOfIpVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRangeIPv6AllOfIpVersion(val *VPCNetworkRangeIPv6AllOfIpVersion) *NullableVPCNetworkRangeIPv6AllOfIpVersion { - return &NullableVPCNetworkRangeIPv6AllOfIpVersion{value: val, isSet: true} -} - -func (v NullableVPCNetworkRangeIPv6AllOfIpVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRangeIPv6AllOfIpVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_network_range_list.go b/services/iaas/v2alpha1api/model_vpc_network_range_list.go deleted file mode 100644 index 2a12229b50..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_network_range_list.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the VPCNetworkRangeList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCNetworkRangeList{} - -// VPCNetworkRangeList VPC Network Range list response. -type VPCNetworkRangeList struct { - // A list of VPC network ranges. - Items []VPCNetworkRange `json:"items"` - AdditionalProperties map[string]interface{} -} - -type _VPCNetworkRangeList VPCNetworkRangeList - -// NewVPCNetworkRangeList instantiates a new VPCNetworkRangeList 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 NewVPCNetworkRangeList(items []VPCNetworkRange) *VPCNetworkRangeList { - this := VPCNetworkRangeList{} - this.Items = items - return &this -} - -// NewVPCNetworkRangeListWithDefaults instantiates a new VPCNetworkRangeList 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 NewVPCNetworkRangeListWithDefaults() *VPCNetworkRangeList { - this := VPCNetworkRangeList{} - return &this -} - -// GetItems returns the Items field value -func (o *VPCNetworkRangeList) GetItems() []VPCNetworkRange { - if o == nil { - var ret []VPCNetworkRange - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *VPCNetworkRangeList) GetItemsOk() ([]VPCNetworkRange, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *VPCNetworkRangeList) SetItems(v []VPCNetworkRange) { - o.Items = v -} - -func (o VPCNetworkRangeList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCNetworkRangeList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCNetworkRangeList) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCNetworkRangeList := _VPCNetworkRangeList{} - - err = json.Unmarshal(data, &varVPCNetworkRangeList) - - if err != nil { - return err - } - - *o = VPCNetworkRangeList(varVPCNetworkRangeList) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCNetworkRangeList struct { - value *VPCNetworkRangeList - isSet bool -} - -func (v NullableVPCNetworkRangeList) Get() *VPCNetworkRangeList { - return v.value -} - -func (v *NullableVPCNetworkRangeList) Set(val *VPCNetworkRangeList) { - v.value = val - v.isSet = true -} - -func (v NullableVPCNetworkRangeList) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCNetworkRangeList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCNetworkRangeList(val *VPCNetworkRangeList) *NullableVPCNetworkRangeList { - return &NullableVPCNetworkRangeList{value: val, isSet: true} -} - -func (v NullableVPCNetworkRangeList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCNetworkRangeList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_routing_table.go b/services/iaas/v2alpha1api/model_vpc_routing_table.go deleted file mode 100644 index 99d33c3362..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_routing_table.go +++ /dev/null @@ -1,443 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the VPCRoutingTable type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCRoutingTable{} - -// VPCRoutingTable An object representing a VPC routing table. Filterable Fields: `createdAt`, `dynamicRoutes`, `name`, `systemRoutes`, `updatedAt`. -type VPCRoutingTable struct { - // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - // A config setting for a routing table which allows propagation of dynamic routes to this routing table. - DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ /._-]*[A-Za-z0-9]+)*$"` - // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. - SystemRoutes *bool `json:"systemRoutes,omitempty"` - // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _VPCRoutingTable VPCRoutingTable - -// NewVPCRoutingTable instantiates a new VPCRoutingTable 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 NewVPCRoutingTable(name string) *VPCRoutingTable { - this := VPCRoutingTable{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - this.Name = name - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// NewVPCRoutingTableWithDefaults instantiates a new VPCRoutingTable 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 NewVPCRoutingTableWithDefaults() *VPCRoutingTable { - this := VPCRoutingTable{} - var dynamicRoutes bool = true - this.DynamicRoutes = &dynamicRoutes - var systemRoutes bool = true - this.SystemRoutes = &systemRoutes - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// 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 *VPCRoutingTable) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *VPCRoutingTable) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// 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 *VPCRoutingTable) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *VPCRoutingTable) SetDescription(v string) { - o.Description = &v -} - -// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetDynamicRoutes() bool { - if o == nil || IsNil(o.DynamicRoutes) { - var ret bool - return ret - } - return *o.DynamicRoutes -} - -// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VPCRoutingTable) GetDynamicRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.DynamicRoutes) { - return nil, false - } - return o.DynamicRoutes, true -} - -// HasDynamicRoutes returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasDynamicRoutes() bool { - if o != nil && !IsNil(o.DynamicRoutes) { - return true - } - - return false -} - -// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. -func (o *VPCRoutingTable) SetDynamicRoutes(v bool) { - o.DynamicRoutes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// 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 *VPCRoutingTable) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *VPCRoutingTable) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *VPCRoutingTable) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *VPCRoutingTable) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *VPCRoutingTable) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *VPCRoutingTable) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *VPCRoutingTable) SetName(v string) { - o.Name = v -} - -// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetSystemRoutes() bool { - if o == nil || IsNil(o.SystemRoutes) { - var ret bool - return ret - } - return *o.SystemRoutes -} - -// 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 *VPCRoutingTable) GetSystemRoutesOk() (*bool, bool) { - if o == nil || IsNil(o.SystemRoutes) { - return nil, false - } - return o.SystemRoutes, true -} - -// HasSystemRoutes returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasSystemRoutes() bool { - if o != nil && !IsNil(o.SystemRoutes) { - return true - } - - return false -} - -// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. -func (o *VPCRoutingTable) SetSystemRoutes(v bool) { - o.SystemRoutes = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *VPCRoutingTable) GetUpdatedAt() time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret time.Time - return ret - } - return *o.UpdatedAt -} - -// 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 *VPCRoutingTable) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *VPCRoutingTable) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *VPCRoutingTable) SetUpdatedAt(v time.Time) { - o.UpdatedAt = &v -} - -func (o VPCRoutingTable) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCRoutingTable) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.DynamicRoutes) { - toSerialize["dynamicRoutes"] = o.DynamicRoutes - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - if !IsNil(o.SystemRoutes) { - toSerialize["systemRoutes"] = o.SystemRoutes - } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCRoutingTable) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCRoutingTable := _VPCRoutingTable{} - - err = json.Unmarshal(data, &varVPCRoutingTable) - - if err != nil { - return err - } - - *o = VPCRoutingTable(varVPCRoutingTable) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "createdAt") - delete(additionalProperties, "description") - delete(additionalProperties, "dynamicRoutes") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "systemRoutes") - delete(additionalProperties, "updatedAt") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCRoutingTable struct { - value *VPCRoutingTable - isSet bool -} - -func (v NullableVPCRoutingTable) Get() *VPCRoutingTable { - return v.value -} - -func (v *NullableVPCRoutingTable) Set(val *VPCRoutingTable) { - v.value = val - v.isSet = true -} - -func (v NullableVPCRoutingTable) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCRoutingTable) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCRoutingTable(val *VPCRoutingTable) *NullableVPCRoutingTable { - return &NullableVPCRoutingTable{value: val, isSet: true} -} - -func (v NullableVPCRoutingTable) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCRoutingTable) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_vpc_routing_table_list.go b/services/iaas/v2alpha1api/model_vpc_routing_table_list.go deleted file mode 100644 index 19cda156c0..0000000000 --- a/services/iaas/v2alpha1api/model_vpc_routing_table_list.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the VPCRoutingTableList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VPCRoutingTableList{} - -// VPCRoutingTableList VPC Routing table response. -type VPCRoutingTableList struct { - // A list of VPC routing tables. - Items []VPCRoutingTable `json:"items"` - AdditionalProperties map[string]interface{} -} - -type _VPCRoutingTableList VPCRoutingTableList - -// NewVPCRoutingTableList instantiates a new VPCRoutingTableList 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 NewVPCRoutingTableList(items []VPCRoutingTable) *VPCRoutingTableList { - this := VPCRoutingTableList{} - this.Items = items - return &this -} - -// NewVPCRoutingTableListWithDefaults instantiates a new VPCRoutingTableList 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 NewVPCRoutingTableListWithDefaults() *VPCRoutingTableList { - this := VPCRoutingTableList{} - return &this -} - -// GetItems returns the Items field value -func (o *VPCRoutingTableList) GetItems() []VPCRoutingTable { - if o == nil { - var ret []VPCRoutingTable - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *VPCRoutingTableList) GetItemsOk() ([]VPCRoutingTable, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *VPCRoutingTableList) SetItems(v []VPCRoutingTable) { - o.Items = v -} - -func (o VPCRoutingTableList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VPCRoutingTableList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *VPCRoutingTableList) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVPCRoutingTableList := _VPCRoutingTableList{} - - err = json.Unmarshal(data, &varVPCRoutingTableList) - - if err != nil { - return err - } - - *o = VPCRoutingTableList(varVPCRoutingTableList) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableVPCRoutingTableList struct { - value *VPCRoutingTableList - isSet bool -} - -func (v NullableVPCRoutingTableList) Get() *VPCRoutingTableList { - return v.value -} - -func (v *NullableVPCRoutingTableList) Set(val *VPCRoutingTableList) { - v.value = val - v.isSet = true -} - -func (v NullableVPCRoutingTableList) IsSet() bool { - return v.isSet -} - -func (v *NullableVPCRoutingTableList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVPCRoutingTableList(val *VPCRoutingTableList) *NullableVPCRoutingTableList { - return &NullableVPCRoutingTableList{value: val, isSet: true} -} - -func (v NullableVPCRoutingTableList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVPCRoutingTableList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/response.go b/services/iaas/v2alpha1api/response.go deleted file mode 100644 index 457491fdd7..0000000000 --- a/services/iaas/v2alpha1api/response.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/services/iaas/v2alpha1api/utils.go b/services/iaas/v2alpha1api/utils.go deleted file mode 100644 index 9be25988eb..0000000000 --- a/services/iaas/v2alpha1api/utils.go +++ /dev/null @@ -1,362 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2alpha1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2alpha1api - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -func IsNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} diff --git a/services/iaas/v2alpha1api/wait/wait.go b/services/iaas/v2alpha1api/wait/wait.go deleted file mode 100644 index 82dc70599a..0000000000 --- a/services/iaas/v2alpha1api/wait/wait.go +++ /dev/null @@ -1,123 +0,0 @@ -package wait - -import ( - "context" - "errors" - "net/http" - "time" - - "github.com/stackitcloud/stackit-sdk-go/core/wait" - iaas "github.com/stackitcloud/stackit-sdk-go/services/iaas/v2alpha1api" -) - -const ( - CreateSuccess = "CREATED" - UpdateSuccess = "UPDATED" - FailedStatus = "FAILED" -) - -// CreateVPCRegionWaitHandler will wait for network area region creation -func CreateVPCRegionWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region string) *wait.AsyncActionHandler[iaas.RegionalVPC] { - waitConfig := wait.WaiterHelper[iaas.RegionalVPC, string]{ - FetchInstance: a.GetVPCRegion(ctx, projectId, vpcId, region).Execute, - GetState: getStateVPCRegion, - ActiveState: []string{CreateSuccess}, - ErrorState: []string{FailedStatus}, - } - - handler := wait.New(waitConfig.Wait()) - handler.SetSleepBeforeWait(2 * time.Second) - handler.SetTimeout(30 * time.Minute) - return handler -} - -// DeleteVPCRegionWaitHandler will wait for network area region deletion -func DeleteVPCRegionWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region string) *wait.AsyncActionHandler[iaas.RegionalVPC] { - waitConfig := wait.WaiterHelper[iaas.RegionalVPC, string]{ - FetchInstance: a.GetVPCRegion(ctx, projectId, vpcId, region).Execute, - GetState: getStateVPCRegion, - ActiveState: []string{}, - ErrorState: []string{FailedStatus}, - - // The IaaS API response with a 400 if the regional network area configuration doesn't exist because of some compatible - // issues to v1. When v1 is deprecated, they probably will respond with 404 - DeleteHttpErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound}, - } - - handler := wait.New(waitConfig.Wait()) - handler.SetSleepBeforeWait(2 * time.Second) - handler.SetTimeout(30 * time.Minute) - return handler -} - -func createOrUpdateVPCNetworkRangeWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region, networkRangeId string) *wait.AsyncActionHandler[iaas.VPCNetworkRange] { - waitConfig := wait.WaiterHelper[iaas.VPCNetworkRange, string]{ - FetchInstance: a.GetVPCNetworkRange(ctx, projectId, vpcId, region, networkRangeId).Execute, - GetState: getStateVPCNetworkRange, - // Usually "CREATED" should be enough as active state. The IaaS API uses "CREATED" always as active state, even after an update. - // To prevent potential issues in the future, we set "UPDATED" also as active state. - ActiveState: []string{CreateSuccess, UpdateSuccess}, - ErrorState: []string{FailedStatus}, - } - - handler := wait.New(waitConfig.Wait()) - handler.SetSleepBeforeWait(5 * time.Second) - handler.SetTimeout(30 * time.Minute) - return handler -} - -// CreateVPCNetworkRangeWaitHandler will wait for VPC Network range creation -func CreateVPCNetworkRangeWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region, networkRangeId string) *wait.AsyncActionHandler[iaas.VPCNetworkRange] { - return createOrUpdateVPCNetworkRangeWaitHandler(ctx, a, projectId, vpcId, region, networkRangeId) -} - -// UpdateVPCNetworkRangeWaitHandler will wait for VPC Network range update -func UpdateVPCNetworkRangeWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region, networkRangeId string) *wait.AsyncActionHandler[iaas.VPCNetworkRange] { - return createOrUpdateVPCNetworkRangeWaitHandler(ctx, a, projectId, vpcId, region, networkRangeId) -} - -// DeleteVPCNetworkRangeWaitHandler will wait for VPC Network range deletion -func DeleteVPCNetworkRangeWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, vpcId, region, networkRangeId string) *wait.AsyncActionHandler[iaas.VPCNetworkRange] { - waitConfig := wait.WaiterHelper[iaas.VPCNetworkRange, string]{ - FetchInstance: a.GetVPCNetworkRange(ctx, projectId, vpcId, region, networkRangeId).Execute, - GetState: getStateVPCNetworkRange, - ErrorState: []string{FailedStatus}, - DeleteHttpErrorStatusCodes: nil, // Use defaults - } - - handler := wait.New(waitConfig.Wait()) - handler.SetSleepBeforeWait(5 * time.Second) - handler.SetTimeout(30 * time.Minute) - return handler -} - -// getStateVPCRegion returns the state of an iaas.RegionalVPC -func getStateVPCRegion(i *iaas.RegionalVPC) (string, error) { - if i == nil { - return "", errors.New("empty response") - } - if i.Status == nil { - return "", errors.New("status is missing in response") - } - return *i.Status, nil -} - -// getStateVPCNetworkRange returns the state of an iaas.VPCNetworkRange -func getStateVPCNetworkRange(i *iaas.VPCNetworkRange) (string, error) { - if i == nil { - return "", errors.New("empty response") - } - if i.VPCNetworkRangeIPv4 != nil { - if i.VPCNetworkRangeIPv4.Status == nil { - return "", errors.New("ipv4 status is missing in response") - } - return *i.VPCNetworkRangeIPv4.Status, nil - } - if i.VPCNetworkRangeIPv6 != nil { - if i.VPCNetworkRangeIPv6.Status == nil { - return "", errors.New("ipv6 status is missing in response") - } - return *i.VPCNetworkRangeIPv6.Status, nil - } - return "", errors.New("unknown status in response") -} diff --git a/services/iaas/v2alpha1api/wait/wait_test.go b/services/iaas/v2alpha1api/wait/wait_test.go deleted file mode 100644 index b2898fa343..0000000000 --- a/services/iaas/v2alpha1api/wait/wait_test.go +++ /dev/null @@ -1,328 +0,0 @@ -package wait - -import ( - "context" - "fmt" - "testing" - "testing/synctest" - "time" - - "github.com/google/go-cmp/cmp" - - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" - "github.com/stackitcloud/stackit-sdk-go/core/utils" - "github.com/stackitcloud/stackit-sdk-go/core/wait" - iaas "github.com/stackitcloud/stackit-sdk-go/services/iaas/v2alpha1api" -) - -type iaasMockSettings struct { - getVPCRegionFails bool - getVPCNetworkRangeFails bool - isDeleted bool - resourceState string -} - -func newIaaSAPIMock(settings *iaasMockSettings) iaas.DefaultAPI { - return &iaas.DefaultAPIServiceMock{ - GetVPCRegionExecuteMock: utils.Ptr(func(_ iaas.ApiGetVPCRegionRequest) (*iaas.RegionalVPC, error) { - if settings.isDeleted { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: 404, - } - } - - if settings.getVPCRegionFails { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: 500, - } - } - - return &iaas.RegionalVPC{ - Status: &settings.resourceState, - }, nil - }), - GetVPCNetworkRangeExecuteMock: utils.Ptr(func(_ iaas.ApiGetVPCNetworkRangeRequest) (*iaas.VPCNetworkRange, error) { - if settings.isDeleted { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: 404, - } - } - - if settings.getVPCNetworkRangeFails { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: 500, - } - } - - return &iaas.VPCNetworkRange{ - VPCNetworkRangeIPv4: &iaas.VPCNetworkRangeIPv4{ - Status: &settings.resourceState, - }, - }, nil - }), - } -} - -func TestCreateNetworkAreaRegionWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "create_succeeded", - getFails: false, - resourceState: CreateSuccess, - wantErr: false, - wantResp: true, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: true, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := newIaaSAPIMock(&iaasMockSettings{ - getVPCRegionFails: tt.getFails, - resourceState: tt.resourceState, - }) - - var wantRes *iaas.RegionalVPC - if tt.wantResp { - wantRes = &iaas.RegionalVPC{ - Status: utils.Ptr(tt.resourceState), - } - } - - handler := CreateVPCRegionWaitHandler(context.Background(), apiClient, "pid", "aid", "region") - - gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !tt.wantErr && !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - }) - } -} - -func TestDeleteNetworkAreaRegionWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - isDeleted bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "delete_succeeded", - getFails: false, - isDeleted: true, - wantErr: false, - wantResp: false, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: false, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := newIaaSAPIMock(&iaasMockSettings{ - getVPCRegionFails: tt.getFails, - isDeleted: tt.isDeleted, - resourceState: tt.resourceState, - }) - - var wantRes *iaas.RegionalVPC - if tt.wantResp { - wantRes = &iaas.RegionalVPC{ - Status: utils.Ptr(tt.resourceState), - } - } - - handler := DeleteVPCRegionWaitHandler(context.Background(), apiClient, "pid", "region", "nid") - - gotRes, err := handler.SetSleepBeforeWait(0).SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !tt.wantErr && !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - }) - } -} - -func TestCreateOrUpdateVPCNetworkRangeWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "update_succeeded", - getFails: false, - resourceState: UpdateSuccess, - wantErr: false, - wantResp: true, - }, - { - desc: "create_succeeded", - getFails: false, - resourceState: CreateSuccess, - wantErr: false, - wantResp: true, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: true, - }, - } - - handlers := map[string]func(context.Context, iaas.DefaultAPI, string, string, string, string) *wait.AsyncActionHandler[iaas.VPCNetworkRange]{ - "common logic": createOrUpdateVPCNetworkRangeWaitHandler, - "create": CreateVPCNetworkRangeWaitHandler, - "update": UpdateVPCNetworkRangeWaitHandler, - } - - for handlerDesc, handlerFn := range handlers { - for _, tt := range tests { - t.Run(fmt.Sprintf("%s - %s", handlerDesc, tt.desc), func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := newIaaSAPIMock(&iaasMockSettings{ - getVPCNetworkRangeFails: tt.getFails, - resourceState: tt.resourceState, - }) - - var wantRes *iaas.VPCNetworkRange - if tt.wantResp { - wantRes = &iaas.VPCNetworkRange{ - VPCNetworkRangeIPv4: &iaas.VPCNetworkRangeIPv4{ - Status: utils.Ptr(tt.resourceState), - }, - } - } - - handler := handlerFn(context.Background(), apiClient, "pid", "vpcId", "region", "nid") - - gotRes, err := handler.WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !tt.wantErr && !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - }) - } - } -} - -func TestDeleteVPCNetworkRangeWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - isDeleted bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "delete_succeeded", - getFails: false, - isDeleted: true, - wantErr: false, - wantResp: false, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: false, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := newIaaSAPIMock(&iaasMockSettings{ - getVPCNetworkRangeFails: tt.getFails, - isDeleted: tt.isDeleted, - resourceState: tt.resourceState, - }) - - var wantRes *iaas.VPCNetworkRange - if tt.wantResp { - wantRes = &iaas.VPCNetworkRange{ - VPCNetworkRangeIPv4: &iaas.VPCNetworkRangeIPv4{ - Status: utils.Ptr(tt.resourceState), - }, - } - } - - handler := DeleteVPCNetworkRangeWaitHandler(context.Background(), apiClient, "pid", "vpcId", "region", "nid") - - gotRes, err := handler.WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !tt.wantErr && !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - }) - } -}